Really really bad local register allocator bug. On X86, it was never using ESI, EDI...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 22 Feb 2008 20:30:53 +0000 (20:30 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 22 Feb 2008 20:30:53 +0000 (20:30 +0000)
it checks if ESI is available, it then looks at registers aliases to ESI. SIL is marked -2 (not allocatable) but isPhysRegAvailable() incorrectly assumes it is in use and returns false for ESI.

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

lib/CodeGen/RegAllocLocal.cpp

index 8f1cce6f4fb96dcdcd36ef511fa9de1ff3401377..99fc6c9028ab7ba4a6d9b3e55c8af02570ba3e2e 100644 (file)
@@ -368,7 +368,7 @@ bool RALocal::isPhysRegAvailable(unsigned PhysReg) const {
   // not free!
   for (const unsigned *AliasSet = TRI->getAliasSet(PhysReg);
        *AliasSet; ++AliasSet)
-    if (PhysRegsUsed[*AliasSet] != -1) // Aliased register in use?
+    if (PhysRegsUsed[*AliasSet] >= 0) // Aliased register in use?
       return false;                    // Can't use this reg then.
   return true;
 }