[llvm-commits] [llvm] r151210 - /llvm/trunk/lib/CodeGen/RegisterScavenging.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Feb 22 14:50:15 PST 2012


Author: stoklund
Date: Wed Feb 22 16:50:14 2012
New Revision: 151210

URL: http://llvm.org/viewvc/llvm-project?rev=151210&view=rev
Log:
Handle regmasks in RegisterScavenging.

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

Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=151210&r1=151209&r2=151210&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Wed Feb 22 16:50:14 2012
@@ -148,6 +148,8 @@
   DefRegs.reset();
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
     const MachineOperand &MO = MI->getOperand(i);
+    if (MO.isRegMask())
+      (isPred ? DefRegs : KillRegs).setBitsNotInMask(MO.getRegMask());
     if (!MO.isReg())
       continue;
     unsigned Reg = MO.getReg();
@@ -279,6 +281,8 @@
     // Remove any candidates touched by instruction.
     for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
       const MachineOperand &MO = MI->getOperand(i);
+      if (MO.isRegMask())
+        Candidates.clearBitsNotInMask(MO.getRegMask());
       if (!MO.isReg() || MO.isUndef() || !MO.getReg())
         continue;
       if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) {





More information about the llvm-commits mailing list