search for: loadinst

Displaying 20 results from an estimated 267 matches for "loadinst".

2013 Jan 28
5
[LLVMdev] Value* to Instruction*/LoadInst* casting
Hello everyone, Can you please tell me if it is possible in LLVM to cast a `Value*` to an `Instruction*/LoadInst*` if for example `isa<LoadInst>(MyValue)` is true? In my particular piece of code: Value* V1 = icmpInstrArray[i]->getOperand(0); Value* V2 = icmpInstrArray[i]->getOperand(1); if (isa<LoadInst>(V1) || isa<LoadInst>(V2)){ ... if(isa<LoadInst>(icmpIns...
2013 Jan 28
0
[LLVMdev] Value* to Instruction*/LoadInst* casting
...ror is : `error: ‘LD100’ was not declared in this scope.` On Mon, Jan 28, 2013 at 11:31 AM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Hello everyone, > > Can you please tell me if it is possible in LLVM to cast a `Value*` to an > `Instruction*/LoadInst*` if for example `isa<LoadInst>(MyValue)` is true? > In my particular piece of code: > > Value* V1 = icmpInstrArray[i]->getOperand(0); > Value* V2 = icmpInstrArray[i]->getOperand(1); > if (isa<LoadInst>(V1) || isa<LoadInst>(V2)){ > ... >...
2013 Jan 28
1
[LLVMdev] Value* to Instruction*/LoadInst* casting
...clared in this scope.` > > On Mon, Jan 28, 2013 at 11:31 AM, Alexandru Ionut Diaconescu < > alexandruionutdiaconescu at gmail.com> wrote: > >> Hello everyone, >> >> Can you please tell me if it is possible in LLVM to cast a `Value*` to an >> `Instruction*/LoadInst*` if for example `isa<LoadInst>(MyValue)` is true? >> In my particular piece of code: >> >> Value* V1 = icmpInstrArray[i]->getOperand(0); >> Value* V2 = icmpInstrArray[i]->getOperand(1); >> if (isa<LoadInst>(V1) || isa<LoadInst>(V2))...
2013 Jan 28
0
[LLVMdev] Value* to Instruction*/LoadInst* casting
Alexandru Ionut Diaconescu wrote: > Hello everyone, > > Can you please tell me if it is possible in LLVM to cast a `Value*` to > an `Instruction*/LoadInst*` if for example `isa<LoadInst>(MyValue)` is > true? http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates In my particular piece of code: > > Value* V1 = icmpInstrArray[i]->getOperand(0); > Value* V2 = icmpInstrArray[i]->getOperand(1)...
2018 Feb 06
2
6 separate instances of static getPointerOperand(). Time to consolidate?
.... Objections? Alternatives? Thanks, Hideki ----------- Relevant background info http://lists.llvm.org/pipermail/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->ge...
2018 Feb 06
0
6 separate instances of static getPointerOperand(). Time to consolidate?
...i > ----------- > Relevant background info > http://lists.llvm.org/pipermail/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)) &...
2018 Feb 06
1
6 separate instances of static getPointerOperand(). Time to consolidate?
...eturns the pointer operand of a load or store /// 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...
2015 Mar 05
4
[LLVMdev] global variable
Hi all, I am newbie for llvm. I just create a global variable, there are some statements in my pass like: LoadInst* int64_64 = new LoadInst(pthreadPID, "", false, OptAplusOne); int64_64->setAlignment(8); int64_64->dump(); LoadInst* int32_65 = new LoadInst(gvar_int32_myFlag, "", false, OptAplusOne); int32_65->setAlignment(4); int32_65->dump(); But when I run...
2008 May 08
0
[LLVMdev] Vector code
...stant vectors and immediate prints the result). :-) Here's essentially what I try to generate: void add(float z[4], float x[4], float y[4]) { z[0] = x[0] + y[0]; z[1] = x[1] + y[1]; z[2] = x[2] + y[2]; z[3] = x[3] + y[3]; } And here's part of the output from the online demo: LoadInst* float_tmp2 = new LoadInst(ptr_x, "tmp2", false, label_entry); LoadInst* float_tmp5 = new LoadInst(ptr_y, "tmp5", false, label_entry); BinaryOperator* float_tmp6 = BinaryOperator::create(Instruction::Add, float_tmp2, float_tmp5, "tmp6", label_entry); StoreInst* void_20...
2018 Dec 12
6
How to get the destination in a LoadInst
Hi all, I have %5 = load i32, i32* %3, align 4 LoadInst and I would like to get reference to the destination ( in this case %5 ). How can I do that? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/1d0bd00c/attachment.html>
2008 May 08
2
[LLVMdev] Vector code
...Here's essentially what I try to generate: > > void add(float z[4], float x[4], float y[4]) > { > z[0] = x[0] + y[0]; > z[1] = x[1] + y[1]; > z[2] = x[2] + y[2]; > z[3] = x[3] + y[3]; > } > > And here's part of the output from the online demo: > > LoadInst* float_tmp2 = new LoadInst(ptr_x, "tmp2", false, > label_entry); > LoadInst* float_tmp5 = new LoadInst(ptr_y, "tmp5", false, > label_entry); > BinaryOperator* float_tmp6 = BinaryOperator::create(Instruction::Add, > float_tmp2, float_tmp5, "tmp6", lab...
2008 May 08
3
[LLVMdev] Vector code
Hi Nicolas (at least, I suspect your signing of your mail with "Anton" was not intentional :-p), > I assume that's the same as the online demo's "Show LLVM C++ API code" > option (http://llvm.org/demo/)? I've tried that with a structure containing > four floating-point components but it also appears to add them individually > using extract/insert. Maybe
2010 Apr 08
4
[LLVMdev] How to Load a Value?
...------------------------ entry: ... %2 = call i32 (...)* @atoi(i8*%1) nounwind /*<- Insertpos*/ ... -- bb1: .. %5 = icmp sgt i32 %2, %i.0 ... ----------------- Now I have pb: pointer to the Value object of *%2* of bb1. Here, I want to generate a load instruction and I did it as: new LoadInst(pb, "load_2", InsertPos); where InsertPos points to the position immediately after "%2 = call i32 (...)* @atoi(i8*%1) nounwind". BUT I got a runtime error as: " include/llvm/Support/Casting.h:199: typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&am...
2018 Aug 31
2
Extending StoreInst/LoadInst
...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 2(load)/3...
2018 Dec 12
2
How to get the destination in a LoadInst
Hi, I would like to get the '5'. I would like to know where the loaded value is stored. I don't know which method I should use of the LoadInst class. Hope this clarifies Thanks On Wed, Dec 12, 2018, 20:37 Doerfert, Johannes Rudolf <jdoerfert at anl.gov wrote: > The LoadInst is %5. I'm not sure what you mean by reference though. > > On 12/12, Alberto Barbaro via llvm-dev wrote: > > Hi all, > > I have %5 = lo...
2012 Dec 02
3
[LLVMdev] GetElementPtrInst question
Hi all, How can I create an llvm::GetElementPtrInst in which the pointer and the index are in registers previously loaded with llvm::LoadInst ? I mean, the generated instruction will be like this: %1 = getelementptr i8* %myreg1, i32 %myreg2 here, %myreg1 and %myreg2 are previously created by load instructions (llvm::LoadInst). Please, let me know if there is an example of something similar. Thanks for the help, Eduardo
2011 Mar 14
2
[LLVMdev] How to load a data from the address of unsiged long type
...an address that present in a unsigned long address like the following format: Value* addr = CONST(0xc0008000) But I do not know how to read the data from the above addr varaible. I tried the following three kind of code: 1. Code: Value* addr = CONST(0xc0008000); Value* data = new LoadInst(addr, "", false, bb); Error: Segmentation fault 2. Code( use BotVastInst to vern): Value* addr = CONST(0xc0008000); a = new BitCastInst(a, PointerType::get(XgetType(Int32Ty), 0), "", bb); Value* data = new LoadInst(addr, "", false, bb...
2011 Oct 12
1
[LLVMdev] getting object from BitCastInst?
...to be function pointers. From these StoreInsts I would like to get useful information(the function used if a direct assignment, function pointer used, etc) from the getValueOperand() method. Looking through several examples I see that this can return several things like: GlobalVariable, Function, LoadInst or BitCastInst depending on how much "indirection" is used. In the case of BitCastInst my dump shows "%ptr.addr = alloca i8*, align 8", I would like to isolate this just to "ptr". Ive tried doing another dyn_cast to AllocaInt, but I couldn't find any relevant meth...
2014 Feb 01
3
[LLVMdev] LoadInst result
Folks, I have a LLVM instruction like the following %0 = load i32** %pp, align 8 I have a LoadInst &inst handle to this instruction. In addition, i could access the pointer being loaded from using the inst.getPointerOperand... However, is there a way to access the handle to the value being loaded? Essentially, i wanted to access the %0 in the statement listed. The end goal is to do som...
2011 Aug 19
1
[LLVMdev] LLVM: Very simple question
Hi, guys. I'm a newbie to LLVM and have a very simple question. Which instructions should I use (in terms of IRBuilder calls) to allocate an array of bytes in stack (alloca?), then to work with it (from a given offset) as with integer (bitcast?). I mean something like that: unsigned char var[8]; unsigned int offset = 3; int val = *(int*)(&var+offset); /* read */ *(int*)(&var+offset)