search for: getpointersizeinbits

Displaying 13 results from an estimated 13 matches for "getpointersizeinbits".

2012 May 24
1
[LLVMdev] About the result of getPointerSizeInBits();
Hi guys, Does getPointerSizeInBits need to return sizeof(void*) in Platform? I found that getPointerSizeInBits return 8 in x86-32 on win7-64, MSVC 2010. And if I have a struct { i32, i32* }; the structLayout->getElementOffset(1) return 8, but I think 4 is right. In generated ASM, the offset of second element is 4. Thanks. --...
2009 Jul 25
3
[LLVMdev] Bug in ExecutionEngine::getConstantValue() -- Instruction::PtrToInt
...ound a bug in the exection engine's 'constants folding'. Basically APInt's parameters are the wrong way round. Line 577 for lib/ExecutionEngine/ExecutionEngine.cpp :- case Instruction::PtrToInt: { GenericValue GV = getConstantValue(Op0); uint32_t PtrWidth = TD->getPointerSizeInBits(); GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal)); return GV; } Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090725/db18ac2e/attachment.html>
2010 Dec 26
1
[LLVMdev] Generating target dependent function calls
...if you know you've got something like > > char GOMP_foo(pointer, pointer) > > you could declare in a function that would then inquire pointer size > from TargetData like: > > FunctionType *geti8LongLong() { > const PointerType *LongTy = Type::getIntNPtrTy(Context, TD.getPointerSizeInBits()); > std::vector<const Type*> Params = { LongTy, LongTy }; > const Type *ResultTy = Type::getInt8Ty(Context); > return FunctionType::get(ResultTy, ArgTys, 0); > } > > and then just use the return from geti8LongLong() as the function type when you declare the funct...
2010 Dec 26
0
[LLVMdev] Generating target dependent function calls
...to get some of the final parts: i.e. if you know you've got something like char GOMP_foo(pointer, pointer) you could declare in a function that would then inquire pointer size from TargetData like: FunctionType *geti8LongLong() { const PointerType *LongTy = Type::getIntNPtrTy(Context, TD.getPointerSizeInBits()); std::vector<const Type*> Params = { LongTy, LongTy }; const Type *ResultTy = Type::getInt8Ty(Context); return FunctionType::get(ResultTy, ArgTys, 0); } and then just use the return from geti8LongLong() as the function type when you declare the function. Or you can abstract out away...
2011 Dec 13
6
[LLVMdev] GetElementPtr
By LLVM do you mean the backend? I'm not using the backend, so is that i32 on the 0 index the type of the index value or the type of the value to which exists at that index? it seems the pointer itself has no width, it's arbitrary and is handled in the lowering and is target dependent on the bus width. Basically, when I am computing offset I need to know the sizes for add. The size of
2010 Dec 26
2
[LLVMdev] Generating target dependent function calls
On 12/22/2010 03:12 PM, Peter Collingbourne wrote: > On Wed, Dec 22, 2010 at 01:38:06PM -0500, Tobias Grosser wrote: >> Hi, >> >> raghesh and I are working in Polly on automatically generating OpenMP >> calls. This works nicely on a 64bit architecture, >> however the functions we need to generate are slightly different on >> different platforms. >>
2009 Jul 25
0
[LLVMdev] Bug in ExecutionEngine::getConstantValue() -- Instruction::PtrToInt
...tants > folding'. > > Basically APInt's parameters are the wrong way round. > > Line 577 for lib/ExecutionEngine/ExecutionEngine.cpp :- > > case Instruction::PtrToInt: { > GenericValue GV = getConstantValue(Op0); > uint32_t PtrWidth = TD->getPointerSizeInBits(); > GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal)); > return GV; > } > Aaron That looks to be the right order to me: APInt(unsigned numBits, uint64_t val, bool isSigned=false) John. -------------- next part -------------- An HTML attachment was scrubbed... URL:...
2011 Dec 13
1
[LLVMdev] Fwd: GetElementPtr
...nd the size of the > index. > >> > >> The size of the index is simply its type. You would normally > >> sign-extend or truncate to the width of a pointer to do arithmetic, > >> though. > >> > >> You can grab the pointer size from TargetData::getPointerSizeInBits(). > >> > >> -Eli > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/70275bfc/attachment.html>
2011 Dec 13
0
[LLVMdev] GetElementPtr
...index. >> >> >> >> The size of the index is simply its type. You would normally >> >> sign-extend or truncate to the width of a pointer to do arithmetic, >> >> though. >> >> >> >> You can grab the pointer size from TargetData::getPointerSizeInBits(). >> >> >> >> -Eli >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/3ba0f844/attachment.html>
2011 Dec 13
0
[LLVMdev] Fwd: GetElementPtr
...he > > size of the pointer (dedicated by bus width) and the size of the index. > > The size of the index is simply its type. You would normally > sign-extend or truncate to the width of a pointer to do arithmetic, > though. > > You can grab the pointer size from TargetData::getPointerSizeInBits(). > > -Eli > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/cf6edecb/attachment.html>
2009 May 06
4
[LLVMdev] Suggestion: Support union types in IR
Chris Lattner wrote: > On May 5, 2009, at 8:09 PM, Talin wrote: > > >> I wanted to mention, by the way, that my need/desire for this hasn't >> gone away :) >> >> And my wish list still includes support for something like uintptr_t >> - a >> primitive integer type that is defined to always be the same size as a >> pointer, however large or
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...gt; 0006: > > This looks fine. > > 0007: > > + int cmpGEP(const GEPOperator *GEP1, const GEPOperator *GEP2); > + int cmpGEP(const GetElementPtrInst *GEP1, > + const GetElementPtrInst *GEP2) { > > Const members? > > + unsigned BitWidth = DL ? DL->getPointerSizeInBits(AS1) : 1; > + APInt Offset1(BitWidth, 0), Offset2(BitWidth, 0); > + if (DL && > + (GEP1->accumulateConstantOffset(*DL, Offset1) && > + GEP2->accumulateConstantOffset(*DL, Offset2))) > + return cmpAPInt(Offset1, Offset2); > > I think you sho...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
Hi Nick, I tried to rework changes as you requested. One of patches (0004 with extra assertions) has been removed. > + bool isEquivalentType(Type *Ty1, Type *Ty2) const { > + return cmpType(Ty1, Ty2) == 0; > + } > > Why do we still need isEquivalentType? Can we nuke this? Yup. After applying all the patches isEquivalentType will be totally replaced with cmpType. All