search for: gepinst

Displaying 7 results from an estimated 7 matches for "gepinst".

2008 Jul 10
3
[LLVMdev] (GEP) Index validity
...ructions. The first two methods below are methods in StructType and SequentialType. Regardless of any limitations posed by a GEP instruction, I argue that "i8 2" is a perfectly valid index for a struct. The fact that it is not valid for a GEP instruction, should be checked somewhere else (GEPInst constructor or GEPInst::getIndexedValue probably). The last method in the patch is directly related to GEP indices, so asserting only the constness might not be enough, though it would not hurt to make this assert slightly more general (ie, don't check the bitwidth as well). Gr. Matthijs ---...
2019 Nov 06
2
Alias analysis only throwing mayAlias for something that seems should be identifiable as mustAlias
...so_local global [32 x [32 x i32]] zeroinitializer, section ".slow_mem", align 32, !dbg !84 ... %45 = getelementptr inbounds [32 x [32 x i32]], [32 x [32 x i32]]* @ARRAY0, i32 0, i32 %22, i32 7, !dbg !180 store volatile i32 %43, i32* %45, align 4, !dbg !181, !tbaa !148 As you can see, the GEPInst exactly knows it is the ARRAY0, and it knows statically that it is accessing the 7th element. However, when I try to call alias analysis in the LLVM pass, as in AliasAnalysis *AA = ... AA->alias(a, b) where a is the ARRAY0 global variable and b is the GEPInst (%45), I only get mayAlias. When r...
2007 Aug 17
1
[LLVMdev] Inserting trace information during opt transformations
...t; args; args.push_back(PointerType::get(Type::Int8Ty)); FunctionType *FT = FunctionType::get(Type::VoidTy, args, false); TraceFunc = M.getOrInsertFunction("mcp_trace_instruction", FT); return true; } then inserting a suitable CallInst instruction new CallInst(TraceFunc, gepinst, "", *wp); Looking at disassembly output from similar code, I can't just pass the constant array directly to the call because I need a GetElementPtrInst conversion. This is the thing I'm having trouble with. My current attempt is: GetElementPtrInst *gepinst = new...
2008 Jul 13
0
[LLVMdev] (GEP) Index validity
On Jul 10, 2008, at 12:26 PM, Matthijs Kooijman wrote: > Regardless of any limitations posed by a GEP instruction, I > argue that "i8 2" is a perfectly valid index for a struct. Why? What value does that provide? Struct indices are not allowed to be variable, so picking any width constant (that isn't too small) is fine. What problem are you trying to solve here? -Chris
2008 Jul 10
0
[LLVMdev] (GEP) Index validity
I don't think this is right. According to llvm documentation: The index types specified for the 'getelementptr' instruction depend on the pointer type that is being indexed into. Pointer and array types can use a 32-bit or 64-bit integer type but the value will always be sign extended to 64-bits. Structure and packed structure types require i32 constants. Evan On Jul 10,
2008 Jul 15
2
[LLVMdev] (GEP) Index validity
...ethods in StructType and > > SequentialType. Regardless of any limitations posed by a GEP instruction, > > I argue that "i8 2" is a perfectly valid index for a struct. The fact > > that it is not valid for a GEP instruction, should be checked somewhere > > else (GEPInst constructor or GEPInst::getIndexedValue probably). > That's what the documentation is saying though. Struct and packed > structure types require i32 constants. Perhaps I am misunderstanding > something? Ah, I did miss the "only 32 bit" limitation for structs, which makes...
2008 Jul 10
2
[LLVMdev] (GEP) Index validity
Hi all, any comments about this patch? I'd like to get it out of my working copy :-) Gr. Matthijs > Index: lib/VMCore/Type.cpp > =================================================================== > --- lib/VMCore/Type.cpp (revision 53136) > +++ lib/VMCore/Type.cpp (working copy) > @@ -394,9 +394,8 @@ > > bool StructType::indexValid(const Value *V) const { >