From: Jakob Stoklund Olesen Date: Tue, 1 Nov 2011 00:02:31 +0000 (+0000) Subject: Update split candidate correctly when interference cache is full. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7bdf0060a00f04ad03d3c6f294d8db6f4951dbc2;p=oota-llvm.git 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 --- 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)