In my target I want to have mem-mem operations. But PHI instructions use virtual registers and gets converted to a series of CopyFromReg and CopyToReg instructions. These DAGs end up using physical registers.
My first approach was to spill the virtual register to force a mem-mem operation. But I was unable to do this using LowerOperation() and
setOperationAction(ISD::CopyToReg, MVT::i32, Custom);
Any ideas would be appreciated.
Is there a way to modify either PHI instructions to not use CopyFromReg or custom lower CopyFromReg?