[llvm-commits] [llvm] r156560 - /llvm/trunk/lib/CodeGen/RegisterPressure.cpp

Andrew Trick atrick at apple.com
Thu May 10 12:11:49 PDT 2012


Author: atrick
Date: Thu May 10 14:11:49 2012
New Revision: 156560

URL: http://llvm.org/viewvc/llvm-project?rev=156560&view=rev
Log:
RegPressure: fix array index iteration style.

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

Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=156560&r1=156559&r2=156560&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu May 10 14:11:49 2012
@@ -424,14 +424,14 @@
 
   // Kill liveness at live defs.
   // TODO: consider earlyclobbers?
-  for (unsigned i = 0; i < PhysRegOpers.Defs.size(); ++i) {
+  for (unsigned i = 0, e = PhysRegOpers.Defs.size(); i < e; ++i) {
     unsigned Reg = PhysRegOpers.Defs[i];
     if (LivePhysRegs.erase(Reg))
       decreasePhysRegPressure(Reg);
     else
       discoverPhysLiveOut(Reg);
   }
-  for (unsigned i = 0; i < VirtRegOpers.Defs.size(); ++i) {
+  for (unsigned i = 0, e = VirtRegOpers.Defs.size(); i < e; ++i) {
     unsigned Reg = VirtRegOpers.Defs[i];
     if (LiveVirtRegs.erase(Reg))
       decreaseVirtRegPressure(Reg);
@@ -440,14 +440,14 @@
   }
 
   // Generate liveness for uses.
-  for (unsigned i = 0; i < PhysRegOpers.Uses.size(); ++i) {
+  for (unsigned i = 0, e = PhysRegOpers.Uses.size(); i < e; ++i) {
     unsigned Reg = PhysRegOpers.Uses[i];
     if (!hasRegAlias(Reg, LivePhysRegs, TRI)) {
       increasePhysRegPressure(Reg);
       LivePhysRegs.insert(Reg);
     }
   }
-  for (unsigned i = 0; i < VirtRegOpers.Uses.size(); ++i) {
+  for (unsigned i = 0, e = VirtRegOpers.Uses.size(); i < e; ++i) {
     unsigned Reg = VirtRegOpers.Uses[i];
     if (!LiveVirtRegs.count(Reg)) {
       // Adjust liveouts if LiveIntervals are available.
@@ -490,7 +490,7 @@
   collectOperands(CurrPos, PhysRegOpers, VirtRegOpers, TRI, RCI);
 
   // Kill liveness at last uses.
-  for (unsigned i = 0; i < PhysRegOpers.Uses.size(); ++i) {
+  for (unsigned i = 0, e = PhysRegOpers.Uses.size(); i < e; ++i) {
     unsigned Reg = PhysRegOpers.Uses[i];
     if (!hasRegAlias(Reg, LivePhysRegs, TRI))
       discoverPhysLiveIn(Reg);
@@ -500,7 +500,7 @@
       LivePhysRegs.erase(Reg);
     }
   }
-  for (unsigned i = 0; i < VirtRegOpers.Uses.size(); ++i) {
+  for (unsigned i = 0, e = VirtRegOpers.Uses.size(); i < e; ++i) {
     unsigned Reg = VirtRegOpers.Uses[i];
     if (RequireIntervals) {
       const LiveInterval *LI = &LIS->getInterval(Reg);
@@ -518,14 +518,14 @@
   }
 
   // Generate liveness for defs.
-  for (unsigned i = 0; i < PhysRegOpers.Defs.size(); ++i) {
+  for (unsigned i = 0, e = PhysRegOpers.Defs.size(); i < e; ++i) {
     unsigned Reg = PhysRegOpers.Defs[i];
     if (!hasRegAlias(Reg, LivePhysRegs, TRI)) {
       increasePhysRegPressure(Reg);
       LivePhysRegs.insert(Reg);
     }
   }
-  for (unsigned i = 0; i < VirtRegOpers.Defs.size(); ++i) {
+  for (unsigned i = 0, e = VirtRegOpers.Defs.size(); i < e; ++i) {
     unsigned Reg = VirtRegOpers.Defs[i];
     if (LiveVirtRegs.insert(Reg).second)
       increaseVirtRegPressure(Reg);





More information about the llvm-commits mailing list