[llvm-commits] [llvm] r126463 - in /llvm/trunk/lib/CodeGen: AllocationOrder.h RegAllocGreedy.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Feb 24 17:04:23 PST 2011


Author: stoklund
Date: Thu Feb 24 19:04:22 2011
New Revision: 126463

URL: http://llvm.org/viewvc/llvm-project?rev=126463&view=rev
Log:
Try harder to get the hint by preferring to evict hint interference.

Modified:
    llvm/trunk/lib/CodeGen/AllocationOrder.h
    llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Modified: llvm/trunk/lib/CodeGen/AllocationOrder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AllocationOrder.h?rev=126463&r1=126462&r2=126463&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AllocationOrder.h (original)
+++ llvm/trunk/lib/CodeGen/AllocationOrder.h Thu Feb 24 19:04:22 2011
@@ -47,6 +47,8 @@
   /// rewind - Start over from the beginning.
   void rewind() { Pos = 0; }
 
+  /// isHint - Return true if PhysReg is a preferred register.
+  bool isHint(unsigned PhysReg) const { return PhysReg == Hint; }
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=126463&r1=126462&r2=126463&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Thu Feb 24 19:04:22 2011
@@ -379,6 +379,9 @@
     // Best so far.
     BestPhys = PhysReg;
     BestWeight = Weight;
+    // Stop if the hint can be used.
+    if (Order.isHint(PhysReg))
+      break;
   }
 
   if (!BestPhys)





More information about the llvm-commits mailing list