summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-03 20:42:13 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-03 20:42:13 +0000
commiteaa6ed1ad81fab3552ed43fef73cf76cb90d5d94 (patch)
tree7f5565f53640996303284816163ace9d268c9e96 /llvm/lib/CodeGen/SplitKit.cpp
parent3bb2a8153910589eaccb52fb9ae8cbd4237d7f6a (diff)
downloadbcm5719-llvm-eaa6ed1ad81fab3552ed43fef73cf76cb90d5d94.tar.gz
bcm5719-llvm-eaa6ed1ad81fab3552ed43fef73cf76cb90d5d94.zip
Gracefully handle invalid live ranges. Fix PR9831.
Register coalescing can sometimes create live ranges that end in the middle of a basic block without any killing instruction. When SplitKit detects this, it will repair the live range by shrinking it to its uses. Live range splitting also needs to know about this. When the range shrinks so much that it becomes allocatable, live range splitting fails because it can't find a good split point. It is paranoid about making progress, so an allocatable range is considered an error. The coalescer should really not be creating these bad live ranges. They appear when coalescing dead copies. llvm-svn: 130787
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r--llvm/lib/CodeGen/SplitKit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index ac9d72bf62c..feb3d3481b4 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -51,6 +51,7 @@ void SplitAnalysis::clear() {
UseBlocks.clear();
ThroughBlocks.clear();
CurLI = 0;
+ DidRepairRange = false;
}
SlotIndex SplitAnalysis::computeLastSplitPoint(unsigned Num) {
@@ -119,6 +120,7 @@ void SplitAnalysis::analyzeUses() {
if (!calcLiveBlockInfo()) {
// FIXME: calcLiveBlockInfo found inconsistencies in the live range.
// I am looking at you, SimpleRegisterCoalescing!
+ DidRepairRange = true;
DEBUG(dbgs() << "*** Fixing inconsistent live interval! ***\n");
const_cast<LiveIntervals&>(LIS)
.shrinkToUses(const_cast<LiveInterval*>(CurLI));
OpenPOWER on IntegriCloud