summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-14 00:58:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-14 00:58:38 +0000
commit4fcfcf498436533ea9bc59404d10751bc76cfd2c (patch)
tree84f08aa3feb20f087d8bbca14ad08da6bc9bb6dc /lib/CodeGen/RegAllocGreedy.cpp
parent6a9feaac935c9345f825b272cf3225248e282f3f (diff)
downloadllvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.gz
llvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.bz2
llvm-4fcfcf498436533ea9bc59404d10751bc76cfd2c.tar.xz
Revert r135121 which broke a gcc-4.2 builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/CodeGen/RegAllocGreedy.cpp b/lib/CodeGen/RegAllocGreedy.cpp
index 8677a3e257..4728a050b1 100644
--- a/lib/CodeGen/RegAllocGreedy.cpp
+++ b/lib/CodeGen/RegAllocGreedy.cpp
@@ -854,6 +854,11 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
});
InterferenceCache::Cursor &Intf = Cand.Intf;
+
+ // FIXME: We need cache reference counts to guarantee that Intf hasn't been
+ // clobbered.
+ Intf.setPhysReg(IntfCache, Cand.PhysReg);
+
LiveRangeEdit LREdit(VirtReg, NewVRegs, this);
SE->reset(LREdit);
@@ -1247,22 +1252,6 @@ unsigned RAGreedy::tryRegionSplit(LiveInterval &VirtReg, AllocationOrder &Order,
Order.rewind();
while (unsigned PhysReg = Order.next()) {
- // Discard bad candidates before we run out of interference cache cursors.
- // This will only affect register classes with a lot of registers (>32).
- if (NumCands == IntfCache.getMaxCursors()) {
- unsigned WorstCount = ~0u;
- unsigned Worst = 0;
- for (unsigned i = 0; i != NumCands; ++i) {
- if (i == BestCand)
- continue;
- unsigned Count = GlobalCand[i].LiveBundles.count();
- if (Count < WorstCount)
- Worst = i, WorstCount = Count;
- }
- --NumCands;
- GlobalCand[Worst] = GlobalCand[NumCands];
- }
-
if (GlobalCand.size() <= NumCands)
GlobalCand.resize(NumCands+1);
GlobalSplitCandidate &Cand = GlobalCand[NumCands];