Handle register masks in DeadMachineInstructionElim.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 20 Jan 2012 22:27:09 +0000 (22:27 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 20 Jan 2012 22:27:09 +0000 (22:27 +0000)
Don't track live physregs that are clobbered by a register mask operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148588 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DeadMachineInstructionElim.cpp

index ba135e19f4d219adf973151640aed1f815ac469f..aeb0b3ed0222fdc2abfd594d10d987afce817457 100644 (file)
@@ -173,6 +173,13 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
                  *SubRegs; ++SubRegs)
               LivePhysRegs.reset(*SubRegs);
           }
+        } else if (MO.isRegMask()) {
+          // Register mask of preserved registers. All clobbers are dead.
+          if (const uint32_t *Mask = MO.getRegMask())
+            LivePhysRegs.clearBitsNotInMask(Mask);
+          else
+            LivePhysRegs.reset();
+          LivePhysRegs |= ReservedRegs;
         }
       }
       // Record the physreg uses, after the defs, in case a physreg is