[llvm] r195969 - Reverse the order of eviction checks for possible compile time savings. No functionality.

Andrew Trick atrick at apple.com
Fri Nov 29 15:49:38 PST 2013


Author: atrick
Date: Fri Nov 29 17:49:38 2013
New Revision: 195969

URL: http://llvm.org/viewvc/llvm-project?rev=195969&view=rev
Log:
Reverse the order of eviction checks for possible compile time savings. No functionality.

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

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=195969&r1=195968&r2=195969&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Fri Nov 29 17:49:38 2013
@@ -627,6 +627,9 @@ bool RAGreedy::canEvictInterference(Live
         return false;
       if (Urgent)
         continue;
+      // Apply the eviction policy for non-urgent evictions.
+      if (!shouldEvict(VirtReg, IsHint, *Intf, BreaksHint))
+        return false;
       // If !MaxCost.isMax(), then we're just looking for a cheap register.
       // Evicting another local live range in this case could lead to suboptimal
       // coloring.
@@ -634,9 +637,6 @@ bool RAGreedy::canEvictInterference(Live
           !canReassign(*Intf, PhysReg)) {
         return false;
       }
-      // Finally, apply the eviction policy for non-urgent evictions.
-      if (!shouldEvict(VirtReg, IsHint, *Intf, BreaksHint))
-        return false;
     }
   }
   MaxCost = Cost;





More information about the llvm-commits mailing list