Fix UnitTests/2005-05-12-Int64ToFP.c with llc-beta. In particular, do not
authorChris Lattner <sabre@nondot.org>
Tue, 19 Sep 2006 18:02:01 +0000 (18:02 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Sep 2006 18:02:01 +0000 (18:02 +0000)
allow it to go into an infinite loop, filling up the disk!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30494 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocLocal.cpp

index 5b9186dbe35bfb55eef67c88148ed37936548d6d..e42603e62993a90ba6a4dab291430843ead9fdea 100644 (file)
@@ -621,18 +621,21 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
       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;
           }
         }