search for: storeinst

Displaying 20 results from an estimated 253 matches for "storeinst".

2018 Feb 06
2
6 separate instances of static getPointerOperand(). Time to consolidate?
...permail/llvm-dev/2018-January/120164.html if anyone is curious about my cleanup work. ------------- Analysis/Delinearization.cpp static Value *getPointerOperand(Instruction &Inst) { if (LoadInst *Load = dyn_cast<LoadInst>(&Inst)) return Load->getPointerOperand(); else if (StoreInst *Store = dyn_cast<StoreInst>(&Inst)) return Store->getPointerOperand(); else if (GetElementPtrInst *Gep = dyn_cast<GetElementPtrInst>(&Inst)) return Gep->getPointerOperand(); return nullptr; } ------------- Analysis/DependenceAnalysis.cpp static Value *getPoi...
2013 Nov 10
1
[LLVMdev] about creating the first value of the storeinst
Dear All I'm trying to create storeInst using StoreInst *SI = new StoreInst(val, AI, BB); AI is an alloca instruction previously created, BB is the basicBlock I want to put instructionsi in. Val is the value to store. I've created val from a genericValue like this: Value* val = ConstantInt::get(getGlobalContext(), Result.IntVal);...
2018 Feb 06
0
6 separate instances of static getPointerOperand(). Time to consolidate?
...tml > if anyone is curious about my cleanup work. > > ------------- Analysis/Delinearization.cpp > > static Value *getPointerOperand(Instruction &Inst) { > if (LoadInst *Load = dyn_cast<LoadInst>(&Inst)) > return Load->getPointerOperand(); > else if (StoreInst *Store = dyn_cast<StoreInst>(&Inst)) > return Store->getPointerOperand(); > else if (GetElementPtrInst *Gep = dyn_cast<GetElementPtrInst>(&Inst)) > return Gep->getPointerOperand(); > return nullptr; > } > > ------------- Analysis/Dependence...
2018 Feb 06
1
6 separate instances of static getPointerOperand(). Time to consolidate?
.../// instruction. static Value *getPointerOperand(Value *I) { if (auto *LI = dyn_cast<LoadInst>(I)) return LI->getPointerOperand(); if (auto *SI = dyn_cast<StoreInst>(I)) return SI->getPointerOperand(); return nullptr; } /// A helper function that returns the type of loaded or stored value. static Type *getMemInstValueType(Value *I) { assert((isa<LoadInst>(I) || isa<StoreInst&...
2010 Aug 16
1
[LLVMdev] Create the Value object for StoreInst
Hello all, I would like to create a new StoreInst into a basic block. I found that I could use methods like ConstantInt::get() to provide the Value* for the first argument of the constructor of the StoreInst, but I don't know how to provide the second one. For example, if I would to do x = 1, I would like to create the "Value" obje...
2018 Aug 31
2
Extending StoreInst/LoadInst
...will not alias. As for the actual implementation, I am wondering what the recommended strategy is. I am currently aware of: 1) 'metadata as value': this is supported for arguments (like in a call), but, as far as I see, not directly for generic metadata. Not sure how easy it is to add to StoreInst/LoadInst. 2) add an extra 'Value*' member to StoreInst and LoadInst (without changing the operands and the OperandTraits) 3) treat the side channel as (optional) operand 1 for load, and (optional) operand 2 for store. This involves changing the 'operator new' to always allocate for...
2013 Apr 18
2
[LLVMdev] How to retrieve IntToPtr from StoreInst?
hi, i am writing a simple LLVM pass to analyze the Store instruction. my pass derives from InstVisitor class, and the method to handle Store instruction is like this: void MyPass::visitStoreInst(StoreInst &I) { ... } It is pretty simple to handle Store. however, in on test i got an instruction like below: store i8 %tmp5, i8* inttoptr (i32 301959828 to i8*) the second operand is "i8* inttoptr (i32 301959828 to i8*)", and i have no idea how i can retrieve the address 30195...
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
...s=2] store i32 %a, i32* %a_addr store i32* %a_addr, i32** %d, align 4 how can I generate such an Instruction? When I use name = variables.inst[i]->getName() + "address_"; Instruction *AD = new AllocaInst(Type::Int32Ty, ConstantInt::get(Type::Int32Ty, 1), name, alloca_point); StoreInst *SI = new StoreInst(variables.inst[i], AD, alloca_point); StoreInst(SI, GEP, alloca_point); the compiler is happy, but I get the following error at run time: Instructions.cpp:904: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)-&...
2013 Jan 18
0
[LLVMdev] How to get more details from storeInst ?
...that I don't how to get c, 0, 0 from the instruction. this bit i32* getelementptr inbounds ([20 x [20 x i32]]* @c, i32 0, i32 0, i32 0) is a constant expression (ConstantExpr class), not an instruction (you can tell because it is printed inline). If SI is your store instruction (with type StoreInst*) then using SI->getPointerOperand() you get the stored to pointer. Call the result Ptr. You can cast that to a ConstantExpr* using cast<ConstantExpr>(Ptr) This will assert if Ptr isn't a constant expression. You can use dyn_cast instead which will return null if it isn't...
2014 Aug 04
3
[LLVMdev] LLVM AllocaInst and StoreInst
...eGenSymTab(llvm::LLVMContext& context) { > printf("\n CodeGen SymTab \n"); > Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value, > true); > Value *alloc = new AllocaInst(IntegerType::get(context, 32), > aTable.variableName,entry); > StoreInst *ptr = new StoreInst(num,alloc,false,entry); > } Here goes the SymTab definition: struct SymTab { char* variableName; int value; llvm::Value* (*codeGen)(llvm::LLVMContext& context); }; When I try to execute the output file,I get the following error: Assertion failed: (ge...
2013 Jan 18
2
[LLVMdev] How to get more details from storeInst ?
...e other is the pointer. The pointer has no name and it is not a constant. I couldn't move further into the pointer to get the index of the element. Anyone could give me some suggestions on this? -- View this message in context: http://llvm.1065342.n5.nabble.com/How-to-get-more-details-from-storeInst-tp53841.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2013 Apr 18
0
[LLVMdev] How to retrieve IntToPtr from StoreInst?
On 4/18/13 9:56 AM, Jun Koi wrote: > hi, > > i am writing a simple LLVM pass to analyze the Store instruction. > my pass derives from InstVisitor class, and the method to handle Store > instruction is like this: > > void MyPass::visitStoreInst(StoreInst &I) { > ... > } > > It is pretty simple to handle Store. however, in on test i got an > instruction like below: > > store i8 %tmp5, i8* inttoptr (i32 301959828 to i8*) The inttoptr used here is a Constant Expression (llvm::ConstantExpr). You'll need to t...
2016 Dec 16
2
Alignment of the StoreInst
Hi all, I am wondering the semantics of alignment in a StoreInst. For example, in the following code: %A = bitcast i8* %buffer to i32* store i32 %x, i32* %A, align 4 We have an "align 4" in the StoreInst. Does this mean 1) the address 'A' should be aligned to 4 bytes? 2) the lower 2 bits of 'A' should be always 0? Thanks Hongbin...
2018 Mar 09
4
Dump LLVM StoreInst
Hi, I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation. if (isa<StoreInst>(I)){ Value* v = I.getOperand(0); Instruction* op1 = dyn_cast<Instruction>(v); errs()<< v <<...
2011 Nov 17
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...t>(I)->getPointerOperand(); > + Jptr = cast<LoadInst>(J)->getPointerOperand(); > + Ialign = cast<LoadInst>(I)->getAlignment(); > + Jalign = cast<LoadInst>(J)->getAlignment(); > + } > + else { > + Iptr = cast<StoreInst>(I)->getPointerOperand(); > + Jptr = cast<StoreInst>(J)->getPointerOperand(); > + Ialign = cast<StoreInst>(I)->getAlignment(); > + Jalign = cast<StoreInst>(J)->getAlignment(); > + } Use '} else {'. Also you are just che...
2008 Jun 28
0
[LLVMdev] need to store the address of a variable
..." to see the C++ code that constructs the module from the input bytecode. In your case, the relevant section looks like this: AllocaInst* ptr_a_addr = new AllocaInst(IntegerType::get(32), "a_addr", label_4); AllocaInst* ptr_d = new AllocaInst(PointerTy_1, "d", label_4); StoreInst* void_5 = new StoreInst(int32_a /* argument %a */, ptr_a_addr, false, label_4); StoreInst* void_6 = new StoreInst(ptr_a_addr, ptr_d, false, label_4); void_5 is putting the argument %a into the locally allocated %a_addr. void_6 is taking %a_addr and storing it into %d. > When I use > > na...
2011 Oct 08
0
[LLVMdev] Initializing GC roots
...ding a hook to GCStrategy which replaces the indicated call to ConstantPointerNull::get in LowerIntrinsics::InsertRootInitializers: // Add root initializers. bool MadeChange = false; for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I) if (!InitedRoots.count(*I)) { ====> StoreInst* SI = new StoreInst(ConstantPointerNull::get(cast<PointerType>( ====> cast<PointerType>((*I)->getType())->getElementType())), *I); SI->insertAfter(*I); MadeChange = true; } return MadeChange; But such a change w...
2011 Sep 04
1
[LLVMdev] correct types for ArgumentList?
I'm trying to create and insert a anonymous function that will make a assignment on a GlobalVariable, based on a existing StoreInst. Once I find this StoreInst(which provides me with 2 Value* objects for me to use) I need to pass it to my anonymous function so it can carry out the assignment. I can not get the correct types, at runtime I get a bad signature error. So basically the function is setup to take arguments like this:...
2013 Apr 19
1
[LLVMdev] How to retrieve IntToPtr from StoreInst?
...well at illinois.edu>wrote: > On 4/18/13 9:56 AM, Jun Koi wrote: > > hi, > > i am writing a simple LLVM pass to analyze the Store instruction. > my pass derives from InstVisitor class, and the method to handle Store > instruction is like this: > > void MyPass::visitStoreInst(StoreInst &I) { > ... > } > > It is pretty simple to handle Store. however, in on test i got an > instruction like below: > > store i8 %tmp5, i8* inttoptr (i32 301959828 to i8*) > > > The inttoptr used here is a Constant Expression (llvm::ConstantExpr). > You&...
2016 Dec 16
0
Alignment of the StoreInst
Hi Hongbin, On 16 December 2016 at 11:57, Hongbin Zheng via llvm-dev <llvm-dev at lists.llvm.org> wrote: > We have an "align 4" in the StoreInst. Does this mean > 1) the address 'A' should be aligned to 4 bytes? > 2) the lower 2 bits of 'A' should be always 0? Yes, these are both the same. It means the compiler will assume those facts when reasoning about what that store might do and possibly when choosing what instru...