[llvm-commits] [llvm] r47499 -	/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
    Evan Cheng 
    evan.cheng at apple.com
       
    Fri Feb 22 12:30:53 PST 2008
    
    
  
Author: evancheng
Date: Fri Feb 22 14:30:53 2008
New Revision: 47499
URL: http://llvm.org/viewvc/llvm-project?rev=47499&view=rev
Log:
Really really bad local register allocator bug. On X86, it was never using ESI, EDI, and EBP because of a bug in RALocal::isPhysRegAvailable(). For example, when
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.
Modified:
    llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=47499&r1=47498&r2=47499&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Fri Feb 22 14:30:53 2008
@@ -368,7 +368,7 @@
   // 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;
 }
    
    
More information about the llvm-commits
mailing list