similar to: Added AllocaInsts are relocated in stack

Displaying 20 results from an estimated 4000 matches similar to: "Added AllocaInsts are relocated in stack"

2018 Sep 21
2
Added AllocaInsts are relocated in stack
Hi Tim, Thanks for your reply. However, I have seen that addressSanitizer has done this by placing redzones around each local variable. But i have not figured out yet how they have done it, I was wondering if there is a switch or a method by which I can reset the slotNumbering given to each instruction. By doing so, LLVM would place them in the expected order I guess. Best regards, Saman On
2018 Sep 21
2
Added AllocaInsts are relocated in stack
Oh, I see. Regarding single stack allocation i am not sure how it is possible. For example for each local variable, I need to maintain a 4-byte metadata. for example, if it is a 4 bytes variable (e.i. int), I need to allocate 8, or if it is a struct, let's say 26 bytes, I need to allocate 30 bytes. How it is possible using AllocaInst? Thanks in advance On Fri, Sep 21, 2018 at 9:36 AM Tim
2013 Jul 25
2
[LLVMdev] Error for AllocaInst and Instruction
Hi, For the following code const Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb); Bb->getInstList().push_back(newInst); It gives me the error " error: no matching constructor for initialization of 'llvm::AllocaInst' AllocaInst* newInst = new
2011 Nov 11
2
[LLVMdev] Argument's types mismatch when creating CallInst.
Hello. I have an .bc, which defines @foo(%type* arg1, %type* arg2, %type* arg3). Firstly, i do this: runtimeModule = getLazyIRFileModule("runtime.bc", smd, llctx); then this: fooFunction = runtimeModule->getFunction("foo"); myType = runtimeModule->getTypeByName("type"); After that, i'm creating another module: myModule = new Module("My
2015 Jan 15
2
[LLVMdev] AllocaInst for FunctionType?
Hi, I'm trying to get my head around c++ - IR - c++ API and getting used tramform manual information to code. The manual states alloca is defined for <type>. FunstionType is a type, so alloca for functionType should be possible? Not? If we have a valid Module *m we can get an allocate instruction allocating space for a non-argumented function as follows: AllocaInst* pa2 = new
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
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
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
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
2002 Nov 27
1
[LLVMdev] Instruciton replacement
llvm is giving me some assertion errors when trying to replace an instruction, and I'm not quite sure of what to do. I have the following snippet of code: switch((*I)->getOpcode()) { case Instruction::Malloc: { AllocaInst *AI; AI = new AllocaInst(cast<AllocationInst>(*I)->getAllocatedType(), cast<AllocationInst>(*I)->getArraySize());
2009 Jun 16
3
[LLVMdev] Localizing Globals ?
The code excerpt is from IPO/GlobalOpt.cpp // If this is a first class global and has only one accessing function // and this function is main (which we know is not recursive we can make // this global a local variable) we replace the global with a local alloca // in this function. // // NOTE: It doesn't make sense to promote non single-value types since we // are
2013 Jul 31
1
[LLVMdev] Instruction insertion By Module Pass
Thank you for your help I tried Instruction* p=&( Bb->front()); Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type,"flag", p); that works well but I need to store the value of the variable too. What's the method that could be used to store specific value?? On 30 July 2013 16:01, John Criswell
2013 Jul 30
0
[LLVMdev] Instruction insertion By Module Pass
On 7/30/13 7:44 AM, Rasha Omar wrote: > Hi, > I need to insert new instruction into every basic block like x=1 > or while loop > I tried this code, but it doesn't work > > Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); > AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb); > Bb->getInstList().push_back(newInst); The problem is
2014 Aug 04
3
[LLVMdev] LLVM AllocaInst and StoreInst
Hi, I am trying to write a simple interpreter. I am trying to generate LLVM IR for assignment operation. The code for the generation part looks like this llvm::Value* codeGenSymTab(llvm::LLVMContext& context) { > printf("\n CodeGen SymTab \n"); > Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value, > true); > Value *alloc = new
2007 Mar 06
0
[LLVMdev] alloca & store generation
> Why isn't llvm giving a name to the value returned by the allocas and > using it in the store instructions? Because you pass in an empty string for the name in the new AllocaInst calls below. Replace the empty strings with "argc_addr" or whatever you want. > AllocaInst* argc_alloca = new AllocaInst(argc->getType(), "", >
2014 Jul 07
4
[LLVMdev] Splitting basic block results in unknown instruction type assertion
Hello, I would like to see if this issue is a result of a misunderstanding on my part before I file a bug. I am using LLVM 3.4, built from the source tarballs. My system's uname is "Darwin tyler-air 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64". All I'm trying to do is add a runtime check after all call
2019 Jul 28
2
Efficient way to identify an instruction
Hi Tim, as always thanks for your help. Unfortunately I made a mistake in my email but apart from that I still have problems. Il giorno sab 27 lug 2019 alle ore 11:53 Tim Northover < t.p.northover at gmail.com> ha scritto: > Hi Alberto, > > On Sat, 27 Jul 2019 at 10:09, Alberto Barbaro via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Having the reference I to
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
2009 Jun 16
0
[LLVMdev] Localizing Globals ?
On Tue, Jun 16, 2009 at 2:35 AM, Sanjiv Gupta<sanjiv.gupta at microchip.com> wrote: > What if my global variable was into a different address space than stack? It doesn't matter in terms of semantics: because AnalyzeGlobal returned false, we're guaranteed the address of the global is never taken. I wouldn't be surprised if we end up generating invalid IR in some cases,
2010 Apr 18
0
[LLVMdev] create two Twine object
According to documentation Twines should be used only for temporary values and not stored, so allocating the in heap sounds wrong. I think all you need here is static int varNum; ++varNum; Instruction *sstatusInst = new AllocaInst(StatusTy, Twine("status") + Twine(varNum), entry_inst); Instruction *sreqInst = new AllocaInst(ReqTy, Twine("request") + Twine(varNum),