[llvm-commits] [llvm] r148588 - /llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jan 20 14:27:09 PST 2012


Author: stoklund
Date: Fri Jan 20 16:27:09 2012
New Revision: 148588

URL: http://llvm.org/viewvc/llvm-project?rev=148588&view=rev
Log:
Handle register masks in DeadMachineInstructionElim.

Don't track live physregs that are clobbered by a register mask operand.

Modified:
    llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp

Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=148588&r1=148587&r2=148588&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Fri Jan 20 16:27:09 2012
@@ -173,6 +173,13 @@
                  *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





More information about the llvm-commits mailing list