search for: regread_i32

Displaying 2 results from an estimated 2 matches for "regread_i32".

2009 Jun 24
3
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
...th my intrinsics, but I am having problem understanding, how this should be done. Let's say I have this instruction: %tmp14 = load i32* getelementptr ([32 x i32]* @gpregs, i32 0, i64 28) and i need to read the load's operands and replace it by let's say: %tmp14 = call i32 @llvm.regread_i32.i32(i32 0, i32 1) Here is what I have: //for each instruction of a function for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) { Instruction* i = &(*I); //if this is a load if (isa<LoadInst>(i)) { //now i need to create an instruction that represents a c...
2009 Jun 25
0
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
On Thu, Jun 25, 2009 at 12:32 AM, ihusar<ihusar at fit.vutbr.cz> wrote: >                //now i need to create an instruction that represents a call to a intrinsic >                Function* FIntr = Intrinsic::getDeclaration(&M, Intrinsic::regread_i32); > >                // here it fails: void llvm::CallInst::init(llvm::Value*): >                //Assertion `FTy->getNumParams() == 0 && "Calling a function with bad signature"' failed. >                Instruction* Instr = CallInst::Create(FIntr); You have to...