Displaying 13 results from an estimated 13 matches for "getlimitedvalue".
2013 Jun 25
4
[LLVMdev] get value
Hi Cristianno,
Thank you, it works :)
with an extra cast:
Value *v ......
ConstantInt* RR = (ConstantInt *)v;
uint64_t VV = (RR->getValue()).getLimitedValue();
errs()<<"\nRR "<<VV<<"\n";
________________________________
From: Cristianno Martins <cristiannomartins at gmail.com>
To: Alexandru Ionut Diaconescu <cyrusthevirus001x at yahoo.com>
Cc: "llvmdev at...
2013 Jun 25
0
[LLVMdev] get value
...:
> Hi Cristianno,
>
> Thank you, it works :)
>
> with an extra cast:
> Value *v ......
> ConstantInt* RR = (ConstantInt *)v;
> uint64_t VV =
> (RR->getValue()).getLimitedValue();
> errs()<<"\nRR "<<VV<<"\n";
>
>
> ------------------------------
> *From:* Cristianno Martins <cristiannomartins at gmail.com>
> *To:* Alexandru Ionut Diaconescu <cyrusthevirus001x at yahoo....
2013 Jun 26
0
[LLVMdev] get value
..., it works :)
>
> with an extra cast:
> Value *v ......
> ConstantInt* RR = (ConstantInt *)v;
Please use "cast<ConstantInt>(v)" instead. See
http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates
.
Nick
> uint64_t VV = (RR->getValue()).getLimitedValue();
> errs()<<"\nRR "<<VV<<"\n";
>
>
> *From:* Cristianno Martins <cristiannomartins at gmail.com>
> *To:* Alexandru Ionut Diaconescu <cyrusthevirus001x at yahoo.com>
> *Cc:* "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc...
2013 Jun 25
0
[LLVMdev] get value
Hi Alexandru,
if you have a Value pointer named v, you could use the method v->getValue().
getLimitedValue(), which returns uint64_t, that can be casted as int.
Hope I could help,
--
Cristianno Martins
PhD Student of Computer Science
University of Campinas
cmartins at ic.unicamp.br
<cristiannomartins at hotmail.com>
On Tue, Jun 25, 2013 at 4:05 AM, Alexandru Ionut Diaconescu <
cyrusthevir...
2013 Jun 25
2
[LLVMdev] get value
Hello !
This may be a trivial question, but I cannot get fields from a Value type.
If my Value is i32 1, how can I store 1 in a different structure (an integer) ? For the type, I have getType(). For the value, I see no method in Value.h.
I tried to cast to ConstantExpr and then to get operands, or cast to ConstantDataArray and then use getAsString(), but is not working. How should I get the
2007 May 11
2
[LLVMdev] identifing mallocs with constant sizes
...allocated type
}
else{
// this is an array allocation
if(array size is a Constant){
-- the request size is constant and equal to the size of the
allocated type times the constant array size
if(the array size is a ConstantInt){
-- the array size can be obtained using getLimitedValue()
}
else if(the array size is a ConstantExpr){
-- there should be some way to evaluate the constant
expression???
}
else if(the array size is a ConstantAggregateZero){
-- the malloc is for size 0
}
else if(the array size is a ConstantFP){...
2007 May 11
0
[LLVMdev] identifing mallocs with constant sizes
...is an array allocation
>
> if(array size is a Constant){
> -- the request size is constant and equal to the size of the
> allocated type times the constant array size
>
> if(the array size is a ConstantInt){
> -- the array size can be obtained using getLimitedValue()
> }
> else if(the array size is a ConstantExpr){
> -- there should be some way to evaluate the constant
> expression???
> }
> else if(the array size is a ConstantAggregateZero){
> -- the malloc is for size 0
> }
> el...
2007 Jun 07
2
[LLVMdev] How to call native functions from bytecode run in JIT?
...ddGlobalMapping( get5Function, (void*)get5 );
// verifying it's existance
Function* func = m->getFunction("get5");
if( func == NULL ) {
std::cout << "registered native function not found\n";
exit(-1);
}
// calling it
EE->runFunction(func, noargs).IntVal.getLimitedValue()
As said, it will fail calling the function in Linux (but works in OS
X). Version is LLVM 2.0, OS X 10.4.9, several linux distros
How can I fix this?
When I try to construct a function which will call "get5" it will
fail on OS X, too. I have attached the whole .cpp file containing...
2011 Oct 10
2
[LLVMdev] Adding fixups and relocations late in code generation
...MO.getReg();
unsigned RegNo = getMipsRegisterNumbering(Reg);
return RegNo;
} else if (MO.isImm()) {
return static_cast<unsigned>(MO.getImm());
} else if (MO.isFPImm()) {
return static_cast<unsigned>(APFloat(MO.getFPImm())
.bitcastToAPInt().getHiBits(32).getLimitedValue());
} else if (MO.isExpr()) {
const MCExpr *p_expr = MO.getExpr();
Fixups.push_back(MCFixup::Create(0, p_expr,
MCFixupKind(Mips::fixup_Mips_Branch_PCRel)));
}
return 0;
}
############################################
Later in MipsAsmBackend.cpp:ApplyFixup() I find the value is th...
2018 May 25
1
MSP430: interrupt vector number out of bounds error in v6/trunk (with patch)
...ice routine
interrupt(vector_number) attribute is rejected:
__attribute__ ((interrupt(USCI_A0_VECTOR))) void ISR(void) { }
error: 'interrupt' attribute parameter 48 is out of bounds
This is due to the check in tools/clang/lib/Sema/SemaDeclAttr.cpp:5104
unsigned Num = NumParams.getLimitedValue(255);
if ((Num & 1) || Num > 30) {
S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_bounds)
<< AL.getName() << (int)NumParams.getSExtValue()
<< NumParamsExpr->getSourceRange();
return;
}
Also, the __isr_ symbol is e...
2007 Jun 10
0
[LLVMdev] How to call native functions from bytecode run in JIT?
...; // verifying it's existance
>
> Function* func = m->getFunction("get5");
> if( func == NULL ) {
> std::cout << "registered native function not found\n";
> exit(-1);
> }
>
> // calling it
>
> EE->runFunction(func, noargs).IntVal.getLimitedValue()
>
> As said, it will fail calling the function in Linux (but works in
> OS X). Version is LLVM 2.0, OS X 10.4.9, several linux distros
>
> How can I fix this?
>
> When I try to construct a function which will call "get5" it will
> fail on OS X, too. I have at...
2011 Oct 10
0
[LLVMdev] Adding fixups and relocations late in code generation
...egNo = getMipsRegisterNumbering(Reg);
> return RegNo;
>
> } else if (MO.isImm()) {
> return static_cast<unsigned>(MO.getImm());
> } else if (MO.isFPImm()) {
> return static_cast<unsigned>(APFloat(MO.getFPImm())
> .bitcastToAPInt().getHiBits(32).getLimitedValue());
> } else if (MO.isExpr()) {
> const MCExpr *p_expr = MO.getExpr();
> Fixups.push_back(MCFixup::Create(0, p_expr,
> MCFixupKind(Mips::fixup_Mips_Branch_PCRel)));
> }
> return 0;
> }
>
> ############################################
>
> Later in Mips...
2015 Apr 24
5
[LLVMdev] Loss of precision with very large branch weights
In PR 22718, we are looking at issues with long running applications
producing non-representative frequencies. For example, in these two loops:
int g = 0;
__attribute__((noinline)) void bar() {
g++;
}
extern int printf(const char*, ...);
int main()
{
int i, j, k;
for (i = 0; i < 1000000; i++)
bar();
printf ("g = %d\n", g);
g = 0;
for (i = 0; i < 500000; i++)