Displaying 3 results from an estimated 3 matches for "oneglobalvari".
2012 Dec 02
1
[LLVMdev] GetElementPtrInst question
...that insert new instruction to an existing Module.
Besides, how can you get a reference to myreg1 ? Looking at your
snippet this variable would be a llvm::Value* (I saw that in the
documentation of IRBuilder). All I have in my code is something like:
llvm::LoadInst *inst2 = new llvm::LoadInst( oneGlobalVariable,
"myreg1", inst1);
Probably I can get a Value pointer to the output register from the
inst2 variable, but I don't know how (I couldn't figure out myself by
just reading the documentation).
Any help is very welcome,
Eduardo
2012 Dec 02
0
[LLVMdev] GetElementPtrInst question
Hi,
You'd use an IRBuilder, like you did to create your LoadInsts.
IRBuilder<> IRB(BB);
IRB.CreateGEP(myreg1, myreg2);
I assume because you asked this question, something went wrong when using the above method. What was it? :)
Cheers,
James
________________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] On Behalf Of Eduardo [erocha.ssa
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.