[llvm-commits] [llvm] r62881 - /llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp

Bill Wendling isanbard at gmail.com
Fri Jan 23 13:28:16 PST 2009


Author: void
Date: Fri Jan 23 15:28:15 2009
New Revision: 62881

URL: http://llvm.org/viewvc/llvm-project?rev=62881&view=rev
Log:
Pull r62837 into Dib:

Only check if coalescing is worthwhile when the result is targeting a more
restrictive register class.

Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62881&r1=62880&r2=62881&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Jan 23 15:28:15 2009
@@ -1290,8 +1290,13 @@
       }
     }
 
+    // If we are joining two virtual registers and the resulting register
+    // class is more restrictive (fewer register, smaller size). Check if it's
+    // worth doing the merge.
     if (!SrcIsPhys && !DstIsPhys &&
-        !isWinToJoinCrossClass(LargeReg, SmallReg, Limit)) {
+        (isExtSubReg || DstRC->isASubClass()) &&
+        !isWinToJoinCrossClass(LargeReg, SmallReg,
+                               allocatableRCRegs_[NewRC].count())) {
       DOUT << "\tSrc/Dest are different register classes.\n";
       // Allow the coalescer to try again in case either side gets coalesced to
       // a physical register that's compatible with the other side. e.g.





More information about the llvm-commits mailing list