similar to: [LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?"

2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Is there a recommended way to retrieve the original type from an AllocaInst object? For example, I am creating alloca instructions using the IRBuilder interface like: alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, variableName.c_str() ); and I place the alloca into a symbol table. Later when I am generating instructions for an assignment operation, I want to check the type of
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Thanks Nick, Unfortunately, that is indeed what I asked for but not what I really am looking for. My naive approach is to store symbol table entries as Value* objects so I can allocate global variables and alloca variables and place them into the symbol table and the rest of the code didn't need to know which kind they were, in general. Loads and Stores of these types (as well as other
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
Hi, I'm trying to add function calls in the LLVM IR using the IRBuilder class. I've read both tutorials about functions but I still get assertion errors. I allocate memory for all function arguments and pass them as explained in the tutorial. My code is (this function is supposed to add a call to f in bb at pos): void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos)
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
Curtis Faith wrote: > Is there a recommended way to retrieve the original type from an > AllocaInst object? > > For example, I am creating alloca instructions using the IRBuilder > interface like: > > alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, > variableName.c_str() ); > > and I place the alloca into a symbol table. > > Later when I am
2013 Dec 12
2
[LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems
Hello! I'm newer to LLVM development . I'm trying to use AllocaInst class to construct an instruction , I wrote like this: AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i); but it return the error: error: use of undeclared identifier 'llvm::Int32Ty' AllocaInst *alloc = new AllocaInst(Int32Ty, 0, "indexLoc",i); I
2007 Jul 20
5
[LLVMdev] Seg faulting on vector ops
Hola LLVMers, I'm looking to make use of the vectorization primitives in the Intel chip with the code we generate from LLVM and so I've started experimenting with it. What is the state of the machine code generated for vectors? In my tinkering, I seem to be getting some wonky machine instructions, but I'm most likely just doing something wrong and I'm hoping you can set me in
2008 Feb 16
3
[LLVMdev] linux/x86-64 codegen support
See the bug for a reduction and the gimple trees. validate_arglist definately is rejecting the arglist in EmitBuiltinAlloca. (try: bool TreeToLLVM::EmitBuiltinAlloca(tree exp, Value *&Result) { tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, INTEGER_TYPE, VOID_TYPE)) { debug_tree(arglist); return false; } Value *Amt = Emit(TREE_VALUE(arglist), 0); Amt =
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
You should be able to use the second alternative that Nick proposed: cast<PointerType*>(pointer_value->getType())->getElementType() Reid On Fri, May 28, 2010 at 9:37 AM, Curtis Faith <curtis at curtisfaith.com> wrote: > Thanks Nick, > Unfortunately, that is indeed what I asked for but not what I really am > looking for. > My naive approach is to store symbol table
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
Hello everybody, my problem is, that I want to get an array of pointers to all local variables in a function. This array will be used for transfering these Variables to another execution engine. I've code which generates this array, and a pointer to the target field of the array. name = variables.fname + "_pointerArray"; Instruction* pointerArray = new
2007 Jul 21
0
[LLVMdev] Seg faulting on vector ops
On Fri, 20 Jul 2007, Chuck Rose III wrote: > I'm looking to make use of the vectorization primitives in the Intel > chip with the code we generate from LLVM and so I've started > experimenting with it. What is the state of the machine code generated > for vectors? In my tinkering, I seem to be getting some wonky machine > instructions, but I'm most likely just doing
2015 Jun 30
4
[LLVMdev] Crashes on Windows 8 with >4k stack frames
Hi All, we have an issue with our LLVM-based JIT compiler - executing the compiled code corrupts memory (and subsequently crashes) if we alloca more than 4k of variables (more than 511 8-byte ints). The same code works on Windows 7 (32 and 64 bit), Linux, MacOS. We compile LLVM and our program with Microsoft's Visual Studio 2010. Both debug and release builds are affected. The variables
2013 Dec 12
0
[LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Jin Huang > Subject: [LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems >    AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i); I think you should be using llvm::Type::getInt32Ty(Context), not llvm::Int32Ty, which is for internal LLVM usage.
2007 Jul 24
2
[LLVMdev] Seg faulting on vector ops
Hrm. This problem shouldn't be target specific. I am pretty sure prologue / epilogue inserter aligns stack correctly if there are stack objects with greater than default stack alignment requirement. Seems to be the initial alloca() instruction should specify 16 byte alignment? Evan On Jul 21, 2007, at 2:51 PM, Chris Lattner wrote: > On Fri, 20 Jul 2007, Chuck Rose III wrote:
2008 Nov 17
2
[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
ok.. So I am trying out what you have suggested. I have written the below code which basically tries to write the constant 10 to a file. myprint is a function pointer to a function which takes char * parameter and writes it to file. Value *Ten = ConstantInt::get(Type::Int32Ty, 10); const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); AllocaInst *AI = new AllocaInst(Type::Int32Ty); Value
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
Hi, I want to extract all instruction of the form "alloca %struct.S", where $struct.S is defined as a struct %struct.S = type { i32, i32 } I'm using the following loop: for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++) { AllocaInst* ai; if( (ai = dyn_cast<AllocaInst>(&*i))){ if(ai->getOperand(0)->getType()->getTypeID() ==
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
CreateAlloca(Type) returns an object of type Type*, the memory that can hold an object of type Type. You probably don't want to be creating allocas just before calling the function since 1) if that call winds up in a loop they'll grow your stack frame without bound, and 2) the memory they point to is initially uninitialized. Where did the tutorial tell you to do that? In general, when I
2009 Jun 18
3
[LLVMdev] Initialising global Array
Hi, I try to create a array that has a nonzero initialiser: What i do is, first create the array type. > const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); Then create some constant values for the initializer. > std::vector<Constant*> Initializer; Initializer.reserve(NumEdges); > APInt zero(32,0); Constant* zeroc = ConstantInt::get(zero); > APInt
2007 Jul 20
0
[LLVMdev] Seg faulting on vector ops
Hi Chuck! On Jul 20, 2007, at 11:36 AM, Chuck Rose III wrote: > Hola LLVMers, > > > > I’m looking to make use of the vectorization primitives in the > Intel chip with the code we generate from LLVM and so I’ve started > experimenting with it. What is the state of the machine code > generated for vectors? In my tinkering, I seem to be getting some > wonky
2008 Apr 21
0
[LLVMdev] newbie question for type comparison
Lu Zhao wrote: > Hi, > > I want to extract all instruction of the form "alloca %struct.S", where > $struct.S is defined as a struct > > %struct.S = type { i32, i32 } > > I'm using the following loop: > > for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++) > { > AllocaInst* ai; > if( (ai =
2007 Jul 26
0
[LLVMdev] Seg faulting on vector ops
I am fairly certain this is right. Chuck, can you do a quick experiment for me? Go back to your original code but make sure the alloca instruction specify 16-byte alignment. The code should work. If not, please file a bug. Thanks, Evan On Jul 24, 2007, at 1:58 PM, Evan Cheng wrote: > Hrm. This problem shouldn't be target specific. I am pretty sure > prologue / epilogue inserter