[LLVMdev] LLVM Instruction Operands

Griffin Wright grwright at umich.edu
Thu Jun 2 09:46:28 PDT 2011


Hello all:

I apologize for what I imagine is a rather silly question, but I'm still
somewhat new to LLVM and am stuck.  I am reworking some code that was
originally in the backend involving MachineInstructions and
MachineOperands, and I now need for it to function as an LLVM IR pass,
using just Instructions, etc, and nothing related to 'Machine'.

However, I am not sure how to get the information I need at the IR level. 
I need to iterate over all operands of an instruction, analyzing each
operand to get a register number (if available), see if the operand is a
register or an immediate, get the operand def, and some other stuff.  I
also need to be able to do implicitDef/Use determination on instructions. 
I don't see a way to do this at present.

So, any guidance would be much appreciated.

Thanks!
Griffin Wright



More information about the llvm-dev mailing list