Displaying 15 results from an estimated 15 matches for "createconstgep2_32".
2016 May 09
2
C++ CreateConstGEP questions
...ot;")
Value * CreateConstGEP1_32 (Type *Ty, Value *Ptr, unsigned Idx0, const Twine &Name="")
I'm assuming that this means that the caller can supply the expected type, and get error checking or casting? Or choose to not supply the type and get whatever they get?
But for CreateConstGEP2_32, there is only the variety with the type supplied:
Value * CreateConstGEP2_32 (Type *Ty, Value *Ptr, unsigned Idx0, unsigned Idx1, const Twine &Name="")
For CreateConstGEP2_64, there is only the version with no Type supplied:
Value * CreateConstGEP2_64 (Value *Ptr, uint64_t...
2011 Feb 01
2
[LLVMdev] Convenience methods in ConstantExpr et al
I notice that there's a lot of inconsistency in the various LLVM classes
with respect to convenience methods. Here's some examples:
For creating GEPS, IRBuilder has:
CreateGEP (2 overloads)
CreateInBoundsGEP (2 overloads)
CreateConstGEP1_32
CreateConstInBoundsGEP1_32
CreateConstGEP2_32
CreateConstInBoundsGEP2_32
CreateConstGEP1_64
CreateConstInBoundsGEP1_64
CreateConstGEP2_64
CreateConstInBoundsGEP2_64
CreateStructGEP
All of which are very useful. However, ConstExpression only has:
getGetElementPtr
getGetElementPtr
getInBoundsGetElementPtr
getInBoundsGetElem...
2011 Feb 02
0
[LLVMdev] Convenience methods in ConstantExpr et al
...of inconsistency in the various LLVM classes
> with respect to convenience methods. Here's some examples:
>
> For creating GEPS, IRBuilder has:
>
> CreateGEP (2 overloads)
> CreateInBoundsGEP (2 overloads)
> CreateConstGEP1_32
> CreateConstInBoundsGEP1_32
> CreateConstGEP2_32
> CreateConstInBoundsGEP2_32
> CreateConstGEP1_64
> CreateConstInBoundsGEP1_64
> CreateConstGEP2_64
> CreateConstInBoundsGEP2_64
> CreateStructGEP
>
> All of which are very useful. However, ConstExpression only has:
>
> getGetElementPtr
> getGetEleme...
2011 Feb 02
2
[LLVMdev] Convenience methods in ConstantExpr et al
...LLVM
> classes with respect to convenience methods. Here's some examples:
>
> For creating GEPS, IRBuilder has:
>
> CreateGEP (2 overloads)
> CreateInBoundsGEP (2 overloads)
> CreateConstGEP1_32
> CreateConstInBoundsGEP1_32
> CreateConstGEP2_32
> CreateConstInBoundsGEP2_32
> CreateConstGEP1_64
> CreateConstInBoundsGEP1_64
> CreateConstGEP2_64
> CreateConstInBoundsGEP2_64
> CreateStructGEP
>
> All of which are very useful. However, ConstExpression only has:
>
>...
2017 Jun 05
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...t;ptr type:" << endl;
ptr->getType()->dump();
// Print memory
ctx.EmitCall1("debugPointer", ptr);
// Set class pointer
auto c = ctx.bld.CreateExtractValue(val, 0, "class");
auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
ctx.EmitCall1("debugInt", cx);
ctx.bld.CreateStore(c, cp);
// Set datum
auto d = ctx.bld.CreateExtractValue(val, 1, "datum");
auto dp =...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...ptr->getType()->dump();
>> // Print memory
>> ctx.EmitCall1("debugPointer", ptr);
>> // Set class pointer
>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>> ctx.EmitCall1("debugInt", cx);
>> ctx.bld.CreateStore(c, cp);
>> // Set datum
>> auto d = ctx.bld.CreateExtractValue(val,...
2011 Feb 03
0
[LLVMdev] Convenience methods in ConstantExpr et al
...respect to convenience methods. Here's some examples:
>>
>> For creating GEPS, IRBuilder has:
>>
>> CreateGEP (2 overloads)
>> CreateInBoundsGEP (2 overloads)
>> CreateConstGEP1_32
>> CreateConstInBoundsGEP1_32
>> CreateConstGEP2_32
>> CreateConstInBoundsGEP2_32
>> CreateConstGEP1_64
>> CreateConstInBoundsGEP1_64
>> CreateConstGEP2_64
>> CreateConstInBoundsGEP2_64
>> CreateStructGEP
>>
>> All of which are very useful. However, ConstExpressio...
2010 Feb 27
3
[LLVMdev] Object layout bug for C++ derived class with long long integer
...e this:
struct Foo { Thing *first; Blob *second; unsigned long third; };
Then I have a derived C++ class that look like this:
struct Bar : Foo { long long fourth; }
I generate JIT code to access 'fourth' from a Foo * as follows:
BarPtr = CreateBitCast(FooPtr, BarPtrTy);
FourthPtr = CreateConstGEP2_32(BarPtr, 0, 3);
FourthValue = CreateLoad(FourthPtr);
ConstantValue = ConstantInt::get(FourthValue->getType(), 0x2A4);
ComparisonValue = CreateICmpEQ(FourthValue, ConstantValue);
This appears to work on Linux and MacOSX with LLVM 2.6 and LLVM 2.7. On Windows, however, where I only have LLVM 2....
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works
fine, and does the right thing.
%Any = type { i8*, i32 }
define dllexport void @setGlobal(%Any* %ptr, %Any %value) {
store %Any %value, %Any* %ptr
ret void
}
define dllexport %Any @getGlobal(%Any* %ptr) {
%val = load %Any, %Any* %ptr
ret %Any %val
}
Trying to replace the setGlobal call with what should be
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...t;> // Print memory
>>>> ctx.EmitCall1("debugPointer", ptr);
>>>> // Set class pointer
>>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>>>> ctx.EmitCall1("debugInt", cx);
>>>> ctx.bld.CreateStore(c, cp);
>>>> // Set datum
>>>> a...
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...ry
>>>>>> ctx.EmitCall1("debugPointer", ptr);
>>>>>> // Set class pointer
>>>>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class");
>>>>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0);
>>>>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type());
>>>>>> ctx.EmitCall1("debugInt", cx);
>>>>>> ctx.bld.CreateStore(c, cp);
>>>>>> // Set datu...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
...*x_idx = builder.CreateStructGEP(cB, 0);
...
... < more of the same>
...
return
}
Simple enough, but I can't get past the first CreateStructGEP without the assert. I thought it was a version issue, so I changed the call to:
Value *x_idx = builder.CreateConstGEP2_32(cB, 0, 0);
However I got the same assert. It looks like this line in Instruction.h from LLVM is producing the assert further down the stack:
815 Type *PtrTy = PointerType::get(checkGEPType(
816 getIndexedType(Ptr->getType(), IdxList)),
817...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
...gt; ...
> ... < more of the same>
> ...
> return
> }
>
> Simple enough, but I can't get past the first CreateStructGEP without the assert. I thought it was a version issue, so I changed the call to:
>
> Value *x_idx = builder.CreateConstGEP2_32(cB, 0, 0);
>
> However I got the same assert. It looks like this line in Instruction.h from LLVM is producing the assert further down the stack:
>
> 815 Type *PtrTy = PointerType::get(checkGEPType(
> 816 getIndexedType(Ptr->getType(),...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
...t; more of the same>
> > ...
> > return
> > }
> >
> > Simple enough, but I can't get past the first CreateStructGEP without the assert. I thought it was a version issue, so I changed the call to:
> >
> > Value *x_idx = builder.CreateConstGEP2_32(cB, 0, 0);
> >
> > However I got the same assert. It looks like this line in Instruction.h from LLVM is producing the assert further down the stack:
> >
> > 815 Type *PtrTy = PointerType::get(checkGEPType(
> > 816 getIndex...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
...gt; ...
> > > return
> > > }
> > >
> > > Simple enough, but I can't get past the first CreateStructGEP without the assert. I thought it was a version issue, so I changed the call to:
> > >
> > > Value *x_idx = builder.CreateConstGEP2_32(cB, 0, 0);
> > >
> > > However I got the same assert. It looks like this line in Instruction.h from LLVM is producing the assert further down the stack:
> > >
> > > 815 Type *PtrTy = PointerType::get(checkGEPType(
> > > 816...