summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-11-29 23:49:38 +0000
committerAndrew Trick <atrick@apple.com>2013-11-29 23:49:38 +0000
commit4dc7377b20bb9a1dbdd009bd5a8ff15492e1ff07 (patch)
treecdab9c0ef657386cacb69d4a96ffdfaa6322a408 /lib/CodeGen/RegAllocGreedy.cpp
parentdcb0422f25231f1b375943a0956c46b01c900375 (diff)
downloadllvm-4dc7377b20bb9a1dbdd009bd5a8ff15492e1ff07.tar.gz
llvm-4dc7377b20bb9a1dbdd009bd5a8ff15492e1ff07.tar.bz2
llvm-4dc7377b20bb9a1dbdd009bd5a8ff15492e1ff07.tar.xz
Reverse the order of eviction checks for possible compile time savings. No functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 27dc07b54c..3a02aaec34 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -627,6 +627,9 @@ bool RAGreedy::canEvictInterference(LiveInterval &VirtReg, unsigned PhysReg,
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(LiveInterval &VirtReg, unsigned PhysReg,
!canReassign(*Intf, PhysReg)) {
return false;
}
- // Finally, apply the eviction policy for non-urgent evictions.
- if (!shouldEvict(VirtReg, IsHint, *Intf, BreaksHint))
- return false;
}
}
MaxCost = Cost;