search for: createstructgep

Displaying 20 results from an estimated 22 matches for "createstructgep".

2013 Nov 17
0
[LLVMdev] opposite to CreateStructGEP
Does getelementptr have a counterpart function which unindexes a pointer? In particular, I'm using CreateStructGEP from the builder and want to get back to the struct pointer from a member pointer. fptr = b.CreateStructGEP( sptr, 2 ); //I want to do this sptr = b.CreateUnStructGEP( fptr, sptr_type, 2 ); I know I can calculate the offsets on my own, but it'd be nice to not have to since GEP already does...
2016 Jun 05
2
Migration help required for 3.3 to 3.8
I'm migrating from 3.3 to 3.8 and am having a few problems. `CreateStructGEP` requires a type parameter now. I'm not sure what type it's expecting, so I converted `CreateStructGEP( valuePtr, index )` to `CreateStructGEP( valuePtr->getType(), valuePtr, index )`... would that be correct? `arg_iterator` no longer converst to Value*, I have a lot of this now: &a...
2011 Feb 01
2
[LLVMdev] Convenience methods in ConstantExpr et al
...: 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 getInBoundsGetElementPtr It would be nice if ConstantExpr's GEP-building methods used the same naming convention and had the same convenience methods as IRBuild...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
..._t[ty][tx]; } } //-------------- end kernel file ----------------------------------- ________________________________________ From: Tom Stellard [tom at stellard.net] Sent: Wednesday, August 20, 2014 4:40 PM To: Lowell, Daniel Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] LLVM CreateStructGEP type assert error On Wed, Aug 20, 2014 at 08:55:32PM +0000, Lowell, Daniel wrote: > If I do M.dump(), at the top of the output I have: > Can you post the full .cl file you are compiling? -Tom > %struct.RB = type opaque > > > Further down I have: > > @.str18 = internal ad...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
..."actual" type, so at my pass level "optimization pass" it hasn't resolved it. ________________________________________ From: Tom Stellard [tom at stellard.net] Sent: Wednesday, August 20, 2014 3:43 PM To: Lowell, Daniel Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] LLVM CreateStructGEP type assert error On Wed, Aug 20, 2014 at 08:12:58PM +0000, Lowell, Daniel wrote: > > cB->getType()->getPointerElementType()->dump(); > > > gives: > > %struct.RB = type opaque2189 x_idx = builder.CreateStructGEP(cB, 0); > Ok, sorry. I thought that would...
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
...a <sarathcse19 at gmail.com>wrote: > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs = mBuilder.CreateLoad(lhs); > lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( > mBuilder.getInt64Ty(), 0)); > int typelhs = getValueType(lhs); > rhs = mBuilder.CreateStructGEP(secondArg, 0); > rhs = mBuilder.CreateLoad(rh...
2011 Feb 02
0
[LLVMdev] Convenience methods in ConstantExpr et al
...(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 > getInBoundsGetElementPtr > > It would be nice if ConstantExpr's GEP-building methods used the same > naming convention...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
cB->getType()->getPointerElementType()->dump(); gives: %struct.RB = type opaque2189 x_idx = builder.CreateStructGEP(cB, 0); cB->dump() gives: %struct.RB addrspace(1)* %cB $1 = void //To undo confusion, the last cB is the function arg name. For this example I unfortunately chose the same name for my argument Value* as the argument name. //Also one correction. I am running LLVM 3.2 not 3.4 ___________...
2008 Apr 11
4
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Hi Dominic, +//===-- llvm/Support/IRBuilder.h - Builder for LLVM Instrs -----*- C++ -*-===// is this line the right length? It seems shorter than the similar lines below like this one: +//===----------------------------------------------------------------------===// + GetElementPtrInst *CreateStructGEP(Value *Ptr, unsigned Idx, + const char *Name = "") { + llvm::Value *Idxs[] = { + ConstantInt::get(llvm::Type::Int32Ty, 0), + ConstantInt::get(llvm::Type::Int32Ty, Idx) + }; + return Insert(GetElementPtrInst::Create(Ptr, Idxs, Idxs+2,...
2011 Feb 02
2
[LLVMdev] Convenience methods in ConstantExpr et al
...rloads) > 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 > getInBoundsGetElementPtr > > It would be nice if ConstantExpr's GEP-building methods used the...
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
...<sarathcse19 at gmail.com<mailto:sarathcse19 at gmail.com>> wrote: Hi James, First i converted the void * to int* and then did FPToSI...then did SHL...( because CreateShl only accepts integers... i pointer casted it to int64 type first)... Below is the code snippet.... lhs = mBuilder.CreateStructGEP(firstArg, 0); lhs = mBuilder.CreateLoad(lhs); lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( mBuilder.getInt64Ty(), 0)); int typelhs = getValueType(lhs); rhs = mBuilder.CreateStructGEP(secondArg, 0); rhs = mBuilder.CreateLoad(rhs); rhs = mBuilder.CreateP...
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi, I'm pursuing M.Tech course. As a part of the project work i'm using LLVM as back-end. My project area is "Enhancing the performance of V8 javascript engine using LLVM as a back-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
...e19 at gmail.com> > wrote:**** > > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs = mBuilder.CreateLoad(lhs); > lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( > mBuilder.getInt64Ty(), 0)); > int typelhs = getValueType(lhs); > rhs = mBuilder.CreateStructGEP(secondArg, 0); > rhs = mBuilder.CreateLoad(rh...
2014 Aug 20
2
[LLVMdev] LLVM CreateStructGEP type assert error
Hi all, Running LLVM 3.4 to create a custom pass for OpenCL transformations. I am attempting to GEP into a struct using IRBuilder's CreateStructGEP, but I keep getting this assert: aoc: ../../../../../../compiler/llvm/include/llvm/Instructions.h:703: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed. Which I've decoded as it doesn't recognize my s...
2013 Feb 01
0
[LLVMdev] Structure declaration with IR builder
...RegPtr,false); > llvm::Constant *c = TargetModule->getOrInsertFunction(BB.getBlockName(),ty); > fTest = llvm::cast<llvm::Function>(c); > fTest ->setCallingConv(llvm::CallingConv::C); > > //Access the struct members > llvm:Value *ArgValuePtr = builder->CreateStructGEP(fTest ->arg_begin(),0,"ptrMember1"); > llvm::Valuie *StructValue = builder->CreateLoad(ArgValuePtr,false,"member1"); > > Cheers, > Peter > > Peter Garba - Software Engineer - +49 (0)89 894221 190 - Peter.Garba at safenet-inc.com > > > -----Origin...
2013 Feb 03
0
[LLVMdev] creating a variable structure, getting offset pointer
...ently achieve this by making my wrap structure like this: struct wrap: int32 ref_count PointerType(FunctionType) func_ptr PointerType(Int8) generic_ptr I then allocate a structure large enough for this base and type T. I then just assume T has the same address as "generic_ptr" and use CreateStructGEP to get at that address. However, depending on type T I'm not sure this will always create the correct alignment requirements. How can I correctly create such a structure which guarantees the correct alignment of the T data structure? -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -...
2013 Jan 31
2
[LLVMdev] Structure declaration with IR builder
Hi All, I tryed to create a global structured derived declaration in my compiler by: StructType *st = StructType(getGlobalContext(), elements, false); In dump module i didn't find any code needed to declare a new user data type. Is there a instruction to add this class into current module? Cheers, Manuele
2008 Apr 12
0
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Duncan Sands wrote: > + GetElementPtrInst *CreateStructGEP(Value *Ptr, unsigned Idx, > + const char *Name = "") { > + llvm::Value *Idxs[] = { > + ConstantInt::get(llvm::Type::Int32Ty, 0), > + ConstantInt::get(llvm::Type::Int32Ty, Idx) > + }; > + return Insert(GetElementPtrI...
2011 Feb 03
0
[LLVMdev] Convenience methods in ConstantExpr et al
...teConstGEP1_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 >> getInBoundsGetElementPtr >> >> It would be nice if ConstantExpr's...
2008 Apr 10
0
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Dominic Hamon wrote: > Duncan Sands wrote: >>> Another option that was discussed in #llvm is to nuke LLVMBuilder >>> and rename LLVMFoldingBuilder to LLVMBuilder. If this was the case, >>> I'd argue for a flag in the Builder that could retain the old >>> non-folding functionality for debugging purposes. >>> >> >> this plan