summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-13 16:47:53 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-13 16:47:53 +0000
commitc1c622ef0dd29d1bafd580790aec5231af50abf2 (patch)
tree8faa95b69ab7d3088cc9ed3ddba9f57354892acb /lib/CodeGen/SplitKit.h
parentde9ddbf19ada796c17e3c42eae477055616130df (diff)
downloadllvm-c1c622ef0dd29d1bafd580790aec5231af50abf2.tar.gz
llvm-c1c622ef0dd29d1bafd580790aec5231af50abf2.tar.bz2
llvm-c1c622ef0dd29d1bafd580790aec5231af50abf2.tar.xz
Use a separate LiveRangeCalc for the complement in spill modes.
The complement interval may overlap the other intervals created, so use a separate LiveRangeCalc instance to compute its live range. A LiveRangeCalc instance can only be shared among non-overlapping intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index c00b8d366a..cd6a3065b9 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -273,8 +273,17 @@ private:
/// The new value has no live ranges anywhere.
ValueMap Values;
- /// LRCalc - Cache for computing live ranges and SSA update.
- LiveRangeCalc LRCalc;
+ /// LRCalc - Cache for computing live ranges and SSA update. Each instance
+ /// can only handle non-overlapping live ranges, so use a separate
+ /// LiveRangeCalc instance for the complement interval when in spill mode.
+ LiveRangeCalc LRCalc[2];
+
+ /// getLRCalc - Return the LRCalc to use for RegIdx. In spill mode, the
+ /// complement interval can overlap the other intervals, so it gets its own
+ /// LRCalc instance. When not in spill mode, all intervals can share one.
+ LiveRangeCalc &getLRCalc(unsigned RegIdx) {
+ return LRCalc[SpillMode != SM_Partition && RegIdx != 0];
+ }
/// defValue - define a value in RegIdx from ParentVNI at Idx.
/// Idx does not have to be ParentVNI->def, but it must be contained within