Obvious unnecessary loop removal. Follow through from previous checkin.
authorAndrew Trick <atrick@apple.com>
Tue, 31 Jan 2012 18:54:19 +0000 (18:54 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 31 Jan 2012 18:54:19 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149398 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocFast.cpp

index ceba05cbbd7bc3b325012b254c434c0c62cbd824..a54785d66f66e4fb63d8439951a8b8ad1c6ccc8e 100644 (file)
@@ -775,17 +775,16 @@ void RAFast::addRetOperands(MachineBasicBlock *MBB) {
         continue;
 
       unsigned OperReg = MO.getReg();
-      for (const unsigned *AS = TRI->getOverlaps(Reg); *AS; ++AS) {
-        if (OperReg != *AS)
-          continue;
-        if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
-          // If the ret already has an operand for this physreg or a superset,
-          // don't duplicate it. Set the kill flag if the value is defined.
-          if (hasDef && !MO.isKill())
-            MO.setIsKill();
-          Found = true;
-          break;
-        }
+      if (!TargetRegisterInfo::isPhysicalRegister(OperReg))
+        continue;
+
+      if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
+        // If the ret already has an operand for this physreg or a superset,
+        // don't duplicate it. Set the kill flag if the value is defined.
+        if (hasDef && !MO.isKill())
+          MO.setIsKill();
+        Found = true;
+        break;
       }
     }
     if (!Found)