[LLVMdev] setDesc vs MachineInstrBuilder

Ryan Taylor ryta1203 at gmail.com
Tue Jul 15 16:32:06 PDT 2014


I would like to replace an instruction X that uses Y class register with
the same functionality instruction Z (for example, Y, Z = add... of the
same types) that uses W class register. I'm currently using a Machine
Function Pass at the state MachineSSAOptimization (addPass(myPass) inside
addMachineSSAOptimization() in MyTargetMachine.cpp. Inside my
MachineFunctionPass I am changing the opcode via setDesc.

I was hoping that I could just replace the instruction in this stage and
the register allocator would pick up on the instruction and use the
appropriate register class, but it is still producing Y class register
instead of W?

Should I be using MachineInstrBuilder instead of setDesc and if so why?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140715/76a792dc/attachment.html>


More information about the llvm-dev mailing list