[PATCH] D43042: [MachineOperand][Target] Add target option to disable setting MachineOperand::isRenamable

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 10:44:09 PST 2018

gberry added a comment.

Checking hasExtraRegAllocReg in isRenamable sounds reasonable to me (though it may require the interface to be changed slightly since we'll need the opcode).  An alternative that is closer to what I initially proposed would be to have setReg and addOperand both clear the isRenamable flag.  This way the only operands that would be renamable are those that have been untouched since they were marked renamable by the register allocator.  This would also allow us to get rid of the extra code that I added to clear the renamable flag in some post-RA target code.  Targets would be able to opt in to preserving the renamable flag by correctly preserving the renamable flag in post-RA transformed code, but by default the flag would be set conservatively.  I'm going to try this approach out to see what it looks like and what kind of impact it has unless someone has a reason they think it won't work.



More information about the llvm-commits mailing list