search for: createalloca

Displaying 20 results from an estimated 48 matches for "createalloca".

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 the variable allocated with the CreateAlloca instruction so I can see if I need to do type convers...
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...a call to f in bb at pos): void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) { std::vector<Value*> args; IRBuilder<> builder(bb,pos); for(Function::arg_iterator argit = f->arg_begin();argit!=f->arg_end();argit++){ AllocaInst* allocInst = builder.CreateAlloca(argit->getType()); args.push_back(allocInst); } builder.CreateCall(f,args.begin(),args.end()); } This seems to work for functions without parameters (eg. int foo()), but once a function has a parameter I get the following assertion error: <llvmpath>/lib/VMCore/Instructions.cpp:...
2018 Mar 31
2
[Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
Hi, First, considering I'm using an IRBuilder and a DIBuilder to build my program, how can I automatically bind the CreateAlloca with my named local variable inside the DIBuilder ? Is it automatic with the Twine name of CreateAlloca ? And/Or should I use DIBuilder::createAutoVariable and how ? Then, I'm wondering how to locate back my local variable in memory (register or stack) once i have a DwarfContext ready. I'...
2010 Jul 07
1
[LLVMdev] Alloca and GlobalVariable
...added support for arrays to the front-end for a trading-specific DSL that I'm implementing using LLVM and ran into a minor bump. Internally, I have been treating variables the same whether they end up being GlobalVariables or stack variables allocated with Alloca. I store the Value* I get from CreateAlloca or the Value* I get when I create a new GlobalVariable into my symbol table when emitting the LLVM IR and since they are both pointers the code is essentially the same. When I implemented the code for stack-based arrays using Allocas, I saw the handy ArraySize argument to IRBuilder::CreateAlloca a...
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 in...
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 generating instructions for an assignment operation, I > want to check the type of the variable allocated with the CreateAlloca > instruction so I can...
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
...AM, Nick Lewycky wrote: > 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 generating instructions for an assignment operation, I >> want to check the type of the variable allocated with the CreateAlloca...
2018 Apr 01
2
[Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
Hi Paul, How can i make this call to intrinsic from the c++ code ? I'm not working with the IR language, but directly in C++ with IRBuilder::CreateAlloca. My goal is that one : - Generate machine code with an instance of the class 'IRBuilder' - Emit 'ObjFile' class instance with MCJIT - Create a DwarfContext instance directly from the emitted ObjFile object (DwarfContextInMemory) (on JitEventListener::NotifyObjectEmitted) - Use this...
2018 Apr 01
0
[Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
...illet via llvm-dev Sent: Saturday, March 31, 2018 7:33 AM To: llvm-dev Subject: [llvm-dev] [Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext Hi, First, considering I'm using an IRBuilder and a DIBuilder to build my program, how can I automatically bind the CreateAlloca with my named local variable inside the DIBuilder ? Is it automatic with the Twine name of CreateAlloca ? And/Or should I use DIBuilder::createAutoVariable and how ? Then, I'm wondering how to locate back my local variable in memory (register or stack) once i have a DwarfContext ready. I'...
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
...10, at 1:06 AM, Nick Lewycky wrote: > > 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 generating instructions for an assignment operation, I > > want to check the type of the variable allocated with the CreateAlloca > > instr...
2018 Apr 02
0
[Dwarf] Register a local variable in DIBuilder and locate it later with a DwarfContext
...DbgValueIntrinsic", etc.). On Sun, Apr 1, 2018 at 2:17 PM Vivien Millet via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi Paul, > How can i make this call to intrinsic from the c++ code ? > I'm not working with the IR language, but directly in C++ with > IRBuilder::CreateAlloca. > My goal is that one : > - Generate machine code with an instance of the class 'IRBuilder' > - Emit 'ObjFile' class instance with MCJIT > - Create a DwarfContext instance directly from the emitted ObjFile object > (DwarfContextInMemory) (on JitEventListener::NotifyO...
2014 Feb 18
3
[LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?
...w to create an array type with a size determined through a global variable. Symbolically, something like below: Value *sz = Mod->getOrInsertGlobal("SIZE", Int32Ty); Type *ArrayTy = ArrayType::get(FloatTy, sz) AllocaInst *AI = CreateAlloca(ArrayTy, 0, ""); Thanks, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140217/249b89be/attachment.html>
2015 Jun 30
4
[LLVMdev] Crashes on Windows 8 with >4k stack frames
...), Linux, MacOS. We compile LLVM and our program with Microsoft's Visual Studio 2010. Both debug and release builds are affected. The variables are created en-block at the beginning of the function with code looking like for (i=0; i<513; ++i) { AllocaInst *variable = mBuilder.CreateAlloca(Type::getInt64Ty(mContext),0,""); mBuilder.CreateStore(GetConstI("INT4_8",0),variable); } We have not yet looked at the compiled machine code (same on Win 7 and 8, or differs?). But the 4k limit made us suspicious, as there were some bug reports - some still open - regardi...
2014 Jan 17
2
[LLVMdev] Offset overflow on calling __chkstc and __alloca
...utine needs a big stack frame (> 1 page), the system attempts to call __chkstk to probe the stack. This attempt results in assertion in RuntimeDyldELF::resolveX86_64Relocation(), case ELF::R_X86_64_PC32, because the RealOffset does not fit in 32 bits. Same happens with __alloca (when IRBuilder::CreateAlloca appears in a conditional block). Perhaps the issue can be fixed by using indirect call via 64-bit register or replicating service routines inside jitted block. Is it known issue? Repro is available on demand, just let us know in which form you'd like to get it. Regards, Mikhail --------------...
2017 Oct 11
2
How to create an alloca variable of type i64 in LLVM IR?
To create a stack based (local) 64 bit integer in LLVM IR, I used: Value *var = builder.CreateAlloca(Type::getInt64Ty(Ctx)); I wish to pass this variable to a function "void foo(unsigned long)". I created the signature of function foo() as follows: Constant *func = M->getOrInsertFunction("foo", Type::getVoidTy(Ctx),Type::getInt64Ty(Ctx), NULL); To pass the newly created va...
2020 Feb 29
4
[MCJIT] messy call stack debug on x64 code in VisualStudio
...: https://bugs.llvm.org/show_bug.cgi?id=24233 which is quite similar but it is quite old now, and since the proposed patch has been posted, the code in RuntimeDyldCOFFX86_64.h has changed and it is difficult for me to know if it has really been fixed since or not. Could it be related to the way IR CreateAlloca are used to build local variables ? Could it be related to missing informations inside the PDB ? (I don't know if there is stack related information inside PDB files to ensure good stack walking). Thanks. Vivien -------------- next part -------------- An HTML attachment was scrubbed... URL: &...
2017 Mar 16
5
[RFC] Allow allocas to produce a non-0 address space pointer
...dress space. By changing the address space used for allocas, we can change our generic pointer type to be LLVM's generic pointer type which does have similar properties. The proposal here is to add a -A field to the datalayout string which will specify the address space for allocas. IRBuilder::CreateAlloca and company gain a DataLayout argument, and some intrinsics that currently don't support address spaces need to support them. This has been implemented out of tree before before for CHERI. This has also been proposed before but for different reasons: http://lists.llvm.org/pipermail/llvm-dev/...
2008 Feb 16
3
[LLVMdev] linux/x86-64 codegen support
...uiltinAlloca(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 = CastToSIntType(Amt, Type::Int32Ty); Result = Builder.CreateAlloca(Type::Int8Ty, Amt, "tmp"); return true; } for a pretty (?) print of the tree at that point) Andrew On 2/16/08, Török Edwin <edwintorok at gmail.com> wrote: > Andrew Lenharth wrote: > > Interestingly, in the .i file there are 2 __builtin_alloca, and > > EmitBuiltin...
2009 Aug 05
2
[LLVMdev] Dominator error inserting instructions into BasicBlock
...//Get the symbol table so that we know what to store ValueSymbolTable* vst = first_block->getValueSymbolTable(); IRBuilder <> builder(first_block); for (ValueSymbolTable::iterator vst_it = vst->begin(); vst_it != vst->end(); vst_it++) { AllocaInst* store_var = builder.CreateAlloca(type, 0,my_name.c_str()); builder.CreateStore(symbol, store_var, true); } //Put a terminator on the block builder.CreateRetVoid(); This builds fine, but I get dominator issues when I try to test it with opt. I'm sure that I just don't understand all of the constraints on...
2015 Jun 30
2
[LLVMdev] Crashes on Windows 8 with >4k stack frames
...39;s Visual Studio 2010. Both debug and >> release builds are affected. >> >> The variables are created en-block at the beginning of the function >> with code looking like >> >> for (i=0; i<513; ++i) { >> AllocaInst *variable = >> mBuilder.CreateAlloca(Type::getInt64Ty(mContext),0,""); >> mBuilder.CreateStore(GetConstI("INT4_8",0),variable); >> } >> >> We have not yet looked at the compiled machine code (same on Win 7 and >> 8, or differs?). But the 4k limit made us suspicious, as there were &gt...