aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
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
commit7d6b6a05b549da70b4473f015c97954c2a422724 (patch)
treee680a75be37810632e1b8755158e6ad70dba67be /lib/CodeGen/SplitKit.h
parentad20681cdeaf72383891b153b925624aa585be4d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 2ae760a58d..6305d0cc23 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -97,6 +97,9 @@ private:
/// NumThroughBlocks - Number of live-through blocks.
unsigned NumThroughBlocks;
+ /// DidRepairRange - analyze was forced to shrinkToUses().
+ bool DidRepairRange;
+
SlotIndex computeLastSplitPoint(unsigned Num);
// Sumarize statistics by counting instructions using CurLI.
@@ -113,6 +116,11 @@ public:
/// split.
void analyze(const LiveInterval *li);
+ /// didRepairRange() - Returns true if CurLI was invalid and has been repaired
+ /// by analyze(). This really shouldn't happen, but sometimes the coalescer
+ /// can create live ranges that end in mid-air.
+ bool didRepairRange() const { return DidRepairRange; }
+
/// clear - clear all data structures so SplitAnalysis is ready to analyze a
/// new interval.
void clear();