search for: getzextvalue

Displaying 20 results from an estimated 111 matches for "getzextvalue".

2012 Nov 16
5
[LLVMdev] Assert with getZExtValue()?
Was hoping it might get some help or a better explanation of this: /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed. Program received signal SIGABRT, Aborted. 0x00007ffff6eb4d05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or dir...
2012 Nov 16
0
[LLVMdev] Assert with getZExtValue()?
On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > Was hoping it might get some help or a better explanation of this: > > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed. The error message is exactly what it says: you're trying to call getZExtValue() on an APInt whose value doesn't fit into a uint64_t. > Program received signal SIGABRT, Abort...
2012 Nov 16
2
[LLVMdev] Assert with getZExtValue()?
...16, 2012 at 3:10 PM, Eli Friedman <eli.friedman at gmail.com>wrote: > On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > Was hoping it might get some help or a better explanation of this: > > > > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion > > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed. > > The error message is exactly what it says: you're trying to call > getZExtValue() on an APInt whose value doesn't fit into a uint64_t. > > > Program re...
2012 Dec 03
0
[LLVMdev] Assert with getZExtValue()?
...Eli Friedman <eli.friedman at gmail.com>wrote: > >> On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: >> > Was hoping it might get some help or a better explanation of this: >> > >> > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion >> > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed. >> >> The error message is exactly what it says: you're trying to call >> getZExtValue() on an APInt whose value doesn't fit into a uint64_t. >>...
2012 Dec 04
0
[LLVMdev] Assert with getZExtValue()?
So is there a way to return the value as a string instead? On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > Was hoping it might get some help or a better explanation of this: > > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed. > > Program received signal SIGABRT, Aborted. > 0x00007ffff6eb4d05 in raise (sig=6) at > ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > 64 ../nptl/sysdeps/unix/sysv/linux...
2008 Jul 07
0
[LLVMdev] (GEP) Index validity
...Core/Type.cpp (working copy) @@ -394,9 +394,8 @@ bool StructType::indexValid(const Value *V) const { // Structure indexes require 32-bit integer constants. - if (V->getType() == Type::Int32Ty) - if (const ConstantInt *CU = dyn_cast<ConstantInt>(V)) - return indexValid(CU->getZExtValue()); + if (const ConstantInt *CU = dyn_cast<ConstantInt>(V)) + return indexValid(CU->getZExtValue()); return false; } @@ -1530,9 +1529,8 @@ } bool SequentialType::indexValid(const Value *V) const { - if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType())) -...
2008 Jul 10
2
[LLVMdev] (GEP) Index validity
...@ -394,9 +394,8 @@ > > bool StructType::indexValid(const Value *V) const { > // Structure indexes require 32-bit integer constants. > - if (V->getType() == Type::Int32Ty) > - if (const ConstantInt *CU = dyn_cast<ConstantInt>(V)) > - return indexValid(CU->getZExtValue()); > + if (const ConstantInt *CU = dyn_cast<ConstantInt>(V)) > + return indexValid(CU->getZExtValue()); > return false; > } > > @@ -1530,9 +1529,8 @@ > } > > bool SequentialType::indexValid(const Value *V) const { > - if (const IntegerType *IT...
2008 Jul 07
2
[LLVMdev] (GEP) Index validity
Hi all, I'm fiddling around a bit with programmatically created GEP instructions, which is failing when using i64 for any indix, except the first. The reason behind this, is that StructureType::indexValid only accepts Value* that are constant ints of width 32. I can't really see why this limitation is here. SequentialType solves this slightly differently, it allows for both 32 and 64
2013 Sep 06
2
[LLVMdev] How to get the exact integer from a Value
...type is i32. I think "indexValue" must hold a number which type is int. Now I want to use the exact number which pointed by indexValue , so I do like this: ConstantInt* CI = llvm::cast<llvm::ConstantInt>(indexValue); //This is wrong, so is dyn_cast. uint64_t index = indexValue->getZExtValue(); uint64_t size = index + 1; I don't know if it is the right way. So, could anybody tell the way to get the integer content from a Value* which type is i32? I'll be very very grateful if there is any answer. -------------- next part -------------- An HTML attachment was scrubbed... URL:...
2009 Apr 15
2
[LLVMdev] Error w/ Tablegen + Intrinsics
It seems that Tablegen is generating intrinsic ID's off by in DAGISel.inc In DAGISel.inc, I have the following pattern: int64_t CN1 = Tmp0->getZExtValue(); // Pattern: (intrinsic_w_chain:f32 103:iPTR, GPRF32:f32:$src0, GPRF32:f32:$src1, GPRF32:f32:$src2) // Emits: (MACRO_FMA_f32:f32 GPRF32:f32:$src0, GPRF32:f32:$src1, GPRF32:f32:$src2) // Pattern complexity = 8 cost = 1 size = 0 if (CN1 == INT64_C(103)) { SDValue N2...
2013 Sep 06
0
[LLVMdev] How to get the exact integer from a Value
...named indexValue, and the type is i32. > I think "indexValue" must hold a number which type is int. Correct, but it might not be a constant. > ConstantInt* CI = llvm::cast<llvm::ConstantInt>(indexValue); //This is wrong, so is dyn_cast. > uint64_t index = indexValue->getZExtValue(); > uint64_t size = index + 1; Actually dyn_cast<> is what you want, used like this: ConstantInt* CI = dyn_cast<ConstantInt>(indexValue); int64_t index = (CI == NULL) ? -1 : CI->getZExtValue(); Note that you must use the result of the cast, not the original Value* vari...
2008 Jun 05
0
[LLVMdev] A question about CBackend.cpp
Hi, I'm reading the code in CBackend.cpp and found some wired chunk in void CWriter::printConstant(Constant *CPV) 938 if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) { 939 const Type* Ty = CI->getType(); 940 if (Ty == Type::Int1Ty) 941 Out << (CI->getZExtValue() ? '1' : '0'); 942 else if (Ty == Type::Int32Ty) 943 Out << CI->getZExtValue() << 'u'; 944 else if (Ty->getPrimitiveSizeInBits() > 32) 945 Out << CI->getZExtValue() << "ull"; 946 else { 947 Out << "(("; 948 print...
2009 May 13
2
[LLVMdev] Compiler error: LoopStrengthReduce.cpp
...me, I intend to look through it closely later >> and report more. >> >> So, for now, just keep using (int) in my version until it is fixed >> in trunk? > > I checked in a fix. Also, IndVarSimplify.cpp has the same problem, only one abs usage in it, line 700: if (Max.getZExtValue() > static_cast<uint64_t>(abs(intEV - intIV))) Following your style change: if (Max.getZExtValue() > static_cast<uint64_t>(abs64(intEV - intIV))) Also, why make an abs64, why not just override abs with 64 bit parameters?
2009 Apr 15
0
[LLVMdev] Error w/ Tablegen + Intrinsics
Are you using isTarget = 1 in your intrinsics file? On Apr 14, 2009, at 6:34 PM, Villmow, Micah wrote: > It seems that Tablegen is generating intrinsic ID’s off by in > DAGISel.inc > > In DAGISel.inc, I have the following pattern: > int64_t CN1 = Tmp0->getZExtValue(); > > // Pattern: (intrinsic_w_chain:f32 103:iPTR, GPRF32:f32:$src0, > GPRF32:f32:$src1, GPRF32:f32:$src2) > // Emits: (MACRO_FMA_f32:f32 GPRF32:f32:$src0, GPRF32:f32:$src1, > GPRF32:f32:$src2) > // Pattern complexity = 8 cost = 1 size = 0 > if (CN1 == IN...
2013 Sep 06
1
[LLVMdev] How to get the exact integer from a Value
...and the type is i32. >> I think "indexValue" must hold a number which type is int. > Correct, but it might not be a constant. > >> ConstantInt* CI = llvm::cast<llvm::ConstantInt>(indexValue); //This is wrong, so is dyn_cast. >> uint64_t index = indexValue->getZExtValue(); >> uint64_t size = index + 1; > Actually dyn_cast<> is what you want, used like this: > > ConstantInt* CI = dyn_cast<ConstantInt>(indexValue); > int64_t index = (CI == NULL) ? -1 : CI->getZExtValue(); > > Note that you must use the result of the c...
2013 Jul 09
1
[LLVMdev] Optimization issue for target's offset field of load operation in DAGSelection
I am working on an experimental target and trying to make sure that the load offset field is used to the best way. There appears to be some control over the architecture's offset range and whether the offset is too large and needs to be lowered/converted into a separate sequence of operations in DAGSelection? Can someone point me to what might be the case? For example, the difference between
2010 Apr 22
0
[LLVMdev] Operand, instruction
if (ConstantInt *c = (ConstantInt *) dyn_cast<ConstantInt>(index)){ errs() << "And it's a constant!!!!!!1111oneone!! (" <<c->getZExtValue() << ")\n"; } -- "Believe you can, believe you can't; either way you're right."  -Henry Ford -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of help__me_please Sent: Thursday, April 22, 2010 8:38...
2018 Mar 09
0
[SelectionDAG] [TargetOp] How to get sub-half of immediate?
...t SDNodes into other values. For a worked example, in the MIPS backend we use this for constant synthesis by materializing the value into a register: (From lib/Target/MipsInstrInfo.td): // Transformation Function - get the lower 16 bits. def LO16 : SDNodeXForm<imm, [{ return getImm(N, N->getZExtValue() & 0xFFFF); }]>; The above fragment will take an immediate node and get the lower 16 bits. // Transformation Function - get the higher 16 bits. def HI16 : SDNodeXForm<imm, [{ return getImm(N, (N->getZExtValue() >> 16) & 0xFFFF); }]>; Similarly, get the high 16 bits....
2013 Feb 26
2
[LLVMdev] Question about intrinsic function llvm.objectsize
...on is that the compiler interpret the pretty vague team "object" in different ways -- the "object" suggested by line 359 @ figure 1 is just a part of the "object" implied by Figure 2. I try to fix the problem PR14988 by replacing line 359 with "Size = Offset.getZextValue()"; It does fix the problem. However, I'm wondering in what situations the Offset != 0. So I put an assertion right before line 359, saying "assert(Offset != 0)". It catches two cases in SingleSource test suite. I investigate one of them, the assertion is triggered when the llv...
2019 Mar 22
2
Understand if a condition was true or false
Hi all, I have the condition of an ICmpInst in a variable called condition obtained doing GenericValue condition = getOperandValue(&I, SF); Now I would like to understand if the comparison was true or false. Is it correct to use condition.IntVal.getSExtValue() and if the value is 0 consider the true and if the value is -1 consider the condition false? I'm not sure because I was expecting