[llvm-dev] ARM Backend: Emit conditional move

Robert Schilling via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 13 01:36:20 PST 2017


I'm trying to emit a conditional move in the ARM backend for a custom 
intrinsic. Basically, I want to emit the following the following 
instruction sequence:

cmp r0, r1
moveq r2, #1

To implement this, I first emit a compare instruction and then I'm 
trying to emit the conditional move, which is failing.

BuildMI(&MBB, DL, TII->get(ARM::CMPrr))

BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(ARM::MOVr),
           .addReg(0); // 's' bit

But with the last conditional move, I am a bit lost. The result of the 
condional move should be saved in operand 0. Can someone help on how to 
emit this instruction?


More information about the llvm-dev mailing list