misched: ILP scheduler for experimental heuristics.
[oota-llvm.git] / lib / CodeGen / MachineCSE.cpp
index 993975ef0ece2b320a5c6ec4b0c1207887881736..896461fd194b52936db2b67755f419337cf91cfe 100644 (file)
@@ -215,11 +215,10 @@ bool MachineCSE::hasLivePhysRegDefUses(const MachineInstr *MI,
     if (MO.isDef() &&
         (MO.isDead() || isPhysDefTriviallyDead(Reg, I, MBB->end())))
       continue;
-    for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
-      // Reading constant physregs is ok.
-      if (!MRI->isConstantPhysReg(*AI, *MBB->getParent()))
+    // Reading constant physregs is ok.
+    if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
+      for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
         PhysRefs.insert(*AI);
-    }
     if (MO.isDef())
       PhysDefs.push_back(Reg);
   }