Non-allocatable physregs can be killed and dead, but don't treat them as
authorChris Lattner <sabre@nondot.org>
Fri, 8 Sep 2006 20:21:31 +0000 (20:21 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 8 Sep 2006 20:21:31 +0000 (20:21 +0000)
safe for later allocation.  This fixes McCat/18-imp with llc-beta.

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

lib/CodeGen/RegAllocLocal.cpp

index 8e7c1fe2a0217a179bccb6670943673fdc1b37ad..5b9186dbe35bfb55eef67c88148ed37936548d6d 100644 (file)
@@ -580,6 +580,9 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
         unsigned &PhysRegSlot = getVirt2PhysRegMapSlot(VirtReg);
         PhysReg = PhysRegSlot;
         PhysRegSlot = 0;
+      } else if (PhysRegsUsed[PhysReg] == -2) {
+        // Unallocatable register dead, ignore.
+        continue;
       }
 
       if (PhysReg) {
@@ -669,6 +672,9 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
         PhysReg = PhysRegSlot;
         assert(PhysReg != 0);
         PhysRegSlot = 0;
+      } else if (PhysRegsUsed[PhysReg] == -2) {
+        // Unallocatable register dead, ignore.
+        continue;
       }
 
       if (PhysReg) {