summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-13 23:09:04 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-13 23:09:04 +0000
commit393bfcb263fa46e4badc73c6aa56306986f94dcf (patch)
tree642df4f74d243122f108fd262ae85d80cd95df01 /lib/CodeGen/SplitKit.h
parentf2e6d33125a45952fb8fbee7e12af63555e88e63 (diff)
downloadllvm-393bfcb263fa46e4badc73c6aa56306986f94dcf.tar.gz
llvm-393bfcb263fa46e4badc73c6aa56306986f94dcf.tar.bz2
llvm-393bfcb263fa46e4badc73c6aa56306986f94dcf.tar.xz
Distinguish complex mapped values from forced recomputation.
When a ParentVNI maps to multiple defs in a new interval, its live range may still be derived directly from RegAssign by transferValues(). On the other hand, when instructions have been rematerialized or hoisted, it may be necessary to completely recompute live ranges using LiveRangeCalc::extend() to all uses. Use a bit in the value map to indicate that a live range must be recomputed. Rename markComplexMapped() to forceRecompute(). This fixes some live range verification errors when -split-spill-mode=size hoists back-copies by recomputing source ranges when RegAssign kills can't be moved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 67e80faefa..5a294e5055 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -250,10 +250,6 @@ private:
/// The current spill mode, selected by reset().
ComplementSpillMode SpillMode;
- /// Parent interval values where the complement interval may be overlapping
- /// other intervals.
- SmallPtrSet<const VNInfo*, 8> OverlappedComplement;
-
typedef IntervalMap<SlotIndex, unsigned> RegAssignMap;
/// Allocator for the interval map. This will eventually be shared with
@@ -265,15 +261,20 @@ private:
/// Idx.
RegAssignMap RegAssign;
- typedef DenseMap<std::pair<unsigned, unsigned>, VNInfo*> ValueMap;
+ typedef PointerIntPair<VNInfo*, 1> ValueForcePair;
+ typedef DenseMap<std::pair<unsigned, unsigned>, ValueForcePair> ValueMap;
/// Values - keep track of the mapping from parent values to values in the new
/// intervals. Given a pair (RegIdx, ParentVNI->id), Values contains:
///
/// 1. No entry - the value is not mapped to Edit.get(RegIdx).
- /// 2. Null - the value is mapped to multiple values in Edit.get(RegIdx).
- /// Each value is represented by a minimal live range at its def.
- /// 3. A non-null VNInfo - the value is mapped to a single new value.
+ /// 2. (Null, false) - the value is mapped to multiple values in
+ /// Edit.get(RegIdx). Each value is represented by a minimal live range at
+ /// its def. The full live range can be inferred exactly from the range
+ /// of RegIdx in RegAssign.
+ /// 3. (Null, true). As above, but the ranges in RegAssign are too large, and
+ /// the live range must be recomputed using LiveRangeCalc::extend().
+ /// 4. (VNI, false) The value is mapped to a single new value.
/// The new value has no live ranges anywhere.
ValueMap Values;
@@ -296,20 +297,11 @@ private:
/// Return the new LI value.
VNInfo *defValue(unsigned RegIdx, const VNInfo *ParentVNI, SlotIndex Idx);
- /// markComplexMapped - Mark ParentVNI as complex mapped in RegIdx regardless
- /// of the number of defs.
- void markComplexMapped(unsigned RegIdx, const VNInfo *ParentVNI);
-
- /// markOverlappedComplement - Mark ParentVNI as being overlapped in the
- /// complement interval. The complement interval may overlap other intervals
- /// after overlapIntv has been called, or when in spill mode.
- void markOverlappedComplement(const VNInfo *ParentVNI);
-
- /// needsRecompute - Returns true if the live range of ParentVNI needs to be
- /// recomputed in RegIdx using LiveRangeCalc::extend. This is the case if
- /// the value has been rematerialized, or when back-copies have been hoisted
- /// in spill mode.
- bool needsRecompute(unsigned RegIdx, const VNInfo *ParentVNI);
+ /// forceRecompute - Force the live range of ParentVNI in RegIdx to be
+ /// recomputed by LiveRangeCalc::extend regardless of the number of defs.
+ /// This is used for values whose live range doesn't match RegAssign exactly.
+ /// They could have rematerialized, or back-copies may have been moved.
+ void forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI);
/// defFromParent - Define Reg from ParentVNI at UseIdx using either
/// rematerialization or a COPY from parent. Return the new value.