Using a stack slot as a destination register for cmov


I’m a computer science student experimenting with the X86 back end for llvm. I’m currently attempting to emit a cmov with the MachineInstructionBuilder, but I’m a little unclear on how I could emit a cmov that writes to a stack slot when its condition is true. I see several usages when there are virtual registers as the destination, but not one that writes to a stack slot. At least that I am able to discern.

In summary: how would I emit a cmov with the machine instruction builder that writes to a stack slot when true?

Thank you in advance,
Genoveva Fossas

You would need to make a MachineInstr that takes an address to store to as input and has no def operands. The address will the stack slot you wish to write. Have you already added a new version of CMOV to X86Instr*.td?