summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-01 00:02:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-01 00:02:31 +0000
commit7bdf0060a00f04ad03d3c6f294d8db6f4951dbc2 (patch)
treef6d9a5025a17e2ecaaf63653e7c675929458d26d /lib/CodeGen/RegAllocGreedy.cpp
parenta7dd4dfccab3ab5b2a7f187baf6522a93d9acab2 (diff)
Update split candidate correctly when interference cache is full.
No test case, spotted by inspection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index f54a2c85d10..71b7f4f7852 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -1118,6 +1118,8 @@ unsigned RAGreedy::tryRegionSplit(LiveInterval &VirtReg, AllocationOrder &Order,
}
--NumCands;
GlobalCand[Worst] = GlobalCand[NumCands];
+ if (BestCand == NumCands)
+ BestCand = Worst;
}
if (GlobalCand.size() <= NumCands)