search for: resulttoprint

Displaying 7 results from an estimated 7 matches for "resulttoprint".

2008 Nov 17
2
[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
...ailCall(true); > > } > > } > > What do I put in the ???. How do I cast Instruction > *inst into char * which can be passed into the function? > > Well, you can do something like the following: > define i32 @f() nounwind { > entry: > %x = alloca i32 > %resulttoprint = call i32 (...)* @a() nounwind > ;start instrumentation > store i32 %resulttoprint, i32* %x, align 4 > %x1 = bitcast i32* %x to i8* > call void @print(i8* %x1) nounwind > ;end instrumentation > ret i32 %resulttoprint > } > > That said, you might need to do something...
2008 Nov 17
0
[LLVMdev] How do I get the result of an instruction?
Thanks Eli! But I still have a question. What you have written is in IR. When I am writing the pass, I donot have access to the result of the instruction (%resulttoprint in your example). All I have is a Instruction* right? So, how do I get the result of the instruction? Am I missing something here? Thanks, Bhavani --- On Sun, 11/16/08, Eli Friedman <eli.friedman at gmail.com> wrote: > From: Eli Friedman <eli.friedman at gmail.com> > Subject...
2008 Nov 17
1
[LLVMdev] How do I get the result of an instruction?
...t cs.uiuc.edu>, "John Criswell" <criswell at uiuc.edu> > Date: Monday, November 17, 2008, 4:20 AM > Thanks Eli! > But I still have a question. What you have written is in > IR. When I am writing the pass, I donot have access to the > result of the instruction (%resulttoprint in your > example). All I have is a Instruction* right? So, how do I > get the result of the instruction? Am I missing something > here? > > Thanks, > Bhavani > > > > --- On Sun, 11/16/08, Eli Friedman > <eli.friedman at gmail.com> wrote: > > >...
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
...he ???. How do I cast > Instruction > >> *inst into char * which can be passed into the > function? > >> > >> Well, you can do something like the following: > >> define i32 @f() nounwind { > >> entry: > >> %x = alloca i32 > >> %resulttoprint = call i32 (...)* @a() nounwind > >> ;start instrumentation > >> store i32 %resulttoprint, i32* %x, align 4 > >> %x1 = bitcast i32* %x to i8* > >> call void @print(i8* %x1) nounwind > >> ;end instrumentation > >> ret i32 %resulttoprint >...
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
...>> *inst into char * which can be passed into > the > >> function? > >>>> Well, you can do something like the > following: > >>>> define i32 @f() nounwind { > >>>> entry: > >>>> %x = alloca i32 > >>>> %resulttoprint = call i32 (...)* @a() > nounwind > >>>> ;start instrumentation > >>>> store i32 %resulttoprint, i32* %x, align > 4 > >>>> %x1 = bitcast i32* %x to i8* > >>>> call void @print(i8* %x1) nounwind > >>>> ;end instrumen...
2008 Nov 16
1
[LLVMdev] How do I get the result of an instruction?
Hi, I am writing an optimization pass where I need to instrument the code such that I need to store the results of some instructions in file. Using llc -march=cpp option I figured out how to add a function(say writeToFile) which takes char* parameter and writes to file. Now, I need put in a CallInst which calls writeToFile passing the Instruction result as parameter. How do I do this? So, in my
2008 Nov 17
0
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
...gt; >>>> function? > >>>>>> Well, you can do something like > the > >> following: > >>>>>> define i32 @f() nounwind { > >>>>>> entry: > >>>>>> %x = alloca i32 > >>>>>> %resulttoprint = call i32 (...)* > @a() > >> nounwind > >>>>>> ;start instrumentation > >>>>>> store i32 %resulttoprint, i32* > %x, align > >> 4 > >>>>>> %x1 = bitcast i32* %x to i8* > >>>>>> call void @...