summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-11-16 01:07:12 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-11-16 01:07:12 +0000
commitfb9b0cdcfe643d8f429c68afbb468ef300602ee0 (patch)
tree2d7322c2eeacd537e7051146885e9e12a5163859 /llvm/lib/CodeGen
parent2d15858e406fa13fe5e1444aa49b5567cd18fcea (diff)
downloadbcm5719-llvm-fb9b0cdcfe643d8f429c68afbb468ef300602ee0.tar.gz
bcm5719-llvm-fb9b0cdcfe643d8f429c68afbb468ef300602ee0.zip
[RegAllocGreedy] Record missed hint for late recoloring.
In https://reviews.llvm.org/D25347, Geoff noticed that we still have useless copy that we can eliminate after register allocation. At the time the allocation is chosen for those copies, they are not useless but, because of changes in the surrounding code, later on they might become useless. The Greedy allocator already has a mechanism to deal with such cases with a late recoloring. However, we missed to record the some of the missed hints. This commit fixes that. llvm-svn: 287070
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocGreedy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 9a0fc66a96b..4a381e0aa83 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -646,6 +646,9 @@ unsigned RAGreedy::tryAssign(LiveInterval &VirtReg,
evictInterference(VirtReg, Hint, NewVRegs);
return Hint;
}
+ // Record the missed hint, we may be able to recover
+ // at the end if the surrounding allocation changed.
+ SetOfBrokenHints.insert(&VirtReg);
}
// Try to evict interference from a cheaper alternative.
OpenPOWER on IntegriCloud