[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp LiveVariables.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Dec 12 19:22:01 PST 2003


Changes in directory llvm/lib/CodeGen:

RegAllocLocal.cpp updated: 1.32 -> 1.33
LiveVariables.cpp updated: 1.11 -> 1.12

---
Log message:

Remove unecessary if statements when looping on ImplicitDefs.


---
Diffs of the changes:  (+10 -10)

Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.32 llvm/lib/CodeGen/RegAllocLocal.cpp:1.33
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.32	Fri Dec  5 05:31:39 2003
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Fri Dec 12 19:20:58 2003
@@ -551,13 +551,13 @@
       }
 
     // Loop over the implicit defs, spilling them as well.
-    if (const unsigned *ImplicitDefs = TID.ImplicitDefs)
-      for (unsigned i = 0; ImplicitDefs[i]; ++i) {
-        unsigned Reg = ImplicitDefs[i];
-        spillPhysReg(MBB, I, Reg);
-        PhysRegsUseOrder.push_back(Reg);
-        PhysRegsUsed[Reg] = 0;            // It is free and reserved now
-      }
+    for (const unsigned *ImplicitDefs = TID.ImplicitDefs;
+         *ImplicitDefs; ++ImplicitDefs) {
+      unsigned Reg = *ImplicitDefs;
+      spillPhysReg(MBB, I, Reg);
+      PhysRegsUseOrder.push_back(Reg);
+      PhysRegsUsed[Reg] = 0;            // It is free and reserved now
+    }
 
     // Okay, we have allocated all of the source operands and spilled any values
     // that would be destroyed by defs of this instruction.  Loop over the


Index: llvm/lib/CodeGen/LiveVariables.cpp
diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.11 llvm/lib/CodeGen/LiveVariables.cpp:1.12
--- llvm/lib/CodeGen/LiveVariables.cpp:1.11	Tue Nov 11 16:41:32 2003
+++ llvm/lib/CodeGen/LiveVariables.cpp	Fri Dec 12 19:20:58 2003
@@ -237,9 +237,9 @@
       }
 
       // Loop over implicit defs, defining them.
-      if (const unsigned *ImplicitDefs = MID.ImplicitDefs)
-	for (unsigned i = 0; ImplicitDefs[i]; ++i)
-	  HandlePhysRegDef(ImplicitDefs[i], MI);
+      for (const unsigned *ImplicitDefs = MID.ImplicitDefs;
+           *ImplicitDefs; ++ImplicitDefs)
+        HandlePhysRegDef(*ImplicitDefs, MI);
 
       // Process all explicit defs...
       for (unsigned i = 0; i != NumOperandsToProcess; ++i) {





More information about the llvm-commits mailing list