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

Chris Lattner sabre at nondot.org
Tue Sep 19 11:02:15 PDT 2006



Changes in directory llvm/lib/CodeGen:

RegAllocLocal.cpp updated: 1.92 -> 1.93
---
Log message:

Fix UnitTests/2005-05-12-Int64ToFP.c with llc-beta.  In particular, do not
allow it to go into an infinite loop, filling up the disk!


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

 RegAllocLocal.cpp |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.92 llvm/lib/CodeGen/RegAllocLocal.cpp:1.93
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.92	Fri Sep  8 15:21:31 2006
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Tue Sep 19 13:02:01 2006
@@ -621,18 +621,21 @@
       for (const unsigned *ImplicitDefs = TID.ImplicitDefs;
            *ImplicitDefs; ++ImplicitDefs) {
         unsigned Reg = *ImplicitDefs;
-        if (PhysRegsUsed[Reg] == -2) continue;
-
-        spillPhysReg(MBB, MI, Reg, true);
-        PhysRegsUseOrder.push_back(Reg);
-        PhysRegsUsed[Reg] = 0;            // It is free and reserved now
+        bool IsNonAllocatable = PhysRegsUsed[Reg] == -2;
+        if (!IsNonAllocatable) {
+          spillPhysReg(MBB, MI, Reg, true);
+          PhysRegsUseOrder.push_back(Reg);
+          PhysRegsUsed[Reg] = 0;            // It is free and reserved now
+        }
         PhysRegsEverUsed[Reg] = true;
 
         for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
              *AliasSet; ++AliasSet) {
           if (PhysRegsUsed[*AliasSet] != -2) {
-            PhysRegsUseOrder.push_back(*AliasSet);
-            PhysRegsUsed[*AliasSet] = 0;  // It is free and reserved now
+            if (!IsNonAllocatable) {
+              PhysRegsUseOrder.push_back(*AliasSet);
+              PhysRegsUsed[*AliasSet] = 0;  // It is free and reserved now
+            }
             PhysRegsEverUsed[*AliasSet] = true;
           }
         }






More information about the llvm-commits mailing list