[llvm] [MachineCP] Correctly handle register masks and sub-registers (PR #122472)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 08:22:03 PST 2025


================
@@ -960,6 +984,10 @@ void MachineCopyPropagation::ForwardCopyPropagateBlock(MachineBasicBlock &MBB) {
     // a large set of registers.  Treat clobbered registers the same way as
     // defined registers.
     if (RegMask) {
+      // Invalidate all entries in the copy map which are not preserved by this
+      // register mask.
+      Tracker.clobberRegistersExceptMask(RegMask, *TRI, *TII, UseCopyInstr);
+
----------------
arsenm wrote:

We should eventually stop tracking register masks and live in registers, and migrate all infrastructure to work in terms of regunits. There is a cost to mapping between the two formats everywhere 

https://github.com/llvm/llvm-project/pull/122472


More information about the llvm-commits mailing list