[LLVMdev] Physical register definition removed by MachineCSE

Mikael Holmén
Fri, 15 Aug 2014 09:18:51 -0000

Hi,

My target has a special configuration register that many instructions
read implicitly, configuring for example if an add instruction should
saturate at over/underflow or not.

Now, I have a problem where the MachineCSE removes a setting of this
configuration register in a basic block, because
MachineCSE::isPhysDefTriviallyDead can't find any uses of it in the
basic block where it's defined.

Similar to other special physical registers, e.g the stack pointer, this
configuration register is marked as "reserved".

Is there anything else I need to do for the MachineCSE to leave this
register and not remove it just because it can't find any uses in the
current basic block?

Best regards,
Mikael Holmén