[llvm-dev] Question about BuildMI()

Josh Sharp via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 20 17:36:44 PST 2019

Let's assume I have an instruction INSTR that takes 3 operands

def INSTR : F_R<0b001010,(outs Regs:$rd) , (ins Regs:$rb, Regs:$ra), ... >

and build this instruction in my code

BuildMI(MB,II,dl, TII.get(INSTR)).add(Ops[0]).add(Ops[1]).add(Ops[2]);

Which Ops element corresponds to which operand?

Is it Ops[0] -> rd, Ops[1] -> rb, Ops[2] -> ra ?

>From MachineInstrBuilder::add() implementation in MachineInstrBuilder.h, I can't tell for sure where the MO argument goes.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190221/78eb3ba3/attachment-0001.html>

More information about the llvm-dev mailing list