<div dir="ltr"><div>Is there a way to assign multiple Register Classes to an instruction with some priority or default? For example, have the default for an instruction be Register Class A but also allow it to be valid for Register Class B (for custom pass tuning)?</div>
<div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 7:32 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>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. </div>

<div><br></div><div>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?</div>

<div><br></div><div>Should I be using MachineInstrBuilder instead of setDesc and if so why?</div><div><br></div><div>Thanks.</div></div>
</blockquote></div><br></div>