aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-02 00:49:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-02 00:49:28 +0000
commitd3fdaeb69a25bcd21914b80f75606e2c2f1b35c8 (patch)
tree2b2bbb9325d6c6753ffcea068f05511e049f0d8f /lib/CodeGen/SplitKit.cpp
parente0ab24532cc11f082d722ab169080322b39afece (diff)
downloadexternal_llvm-d3fdaeb69a25bcd21914b80f75606e2c2f1b35c8.zip
external_llvm-d3fdaeb69a25bcd21914b80f75606e2c2f1b35c8.tar.gz
external_llvm-d3fdaeb69a25bcd21914b80f75606e2c2f1b35c8.tar.bz2
Rename mapValue to extendRange because that is its function now.
Simplify the signature - The return value and ParentVNI are no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.cpp')
-rw-r--r--lib/CodeGen/SplitKit.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 3a5f502..a2214bb 100644
--- a/lib/CodeGen/SplitKit.cpp
+++ b/lib/CodeGen/SplitKit.cpp
@@ -214,24 +214,17 @@ void LiveIntervalMap::reset(LiveInterval *li) {
}
-// mapValue - Find the mapped value for ParentVNI at Idx.
+// extendRange - Extend the live range to reach Idx.
// Potentially create phi-def values.
-VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
- bool *simple) {
+void LiveIntervalMap::extendRange(SlotIndex Idx) {
assert(LI && "call reset first");
- assert(ParentVNI && "Mapping NULL value");
assert(Idx.isValid() && "Invalid SlotIndex");
- assert(ParentLI.getVNInfoAt(Idx) == ParentVNI && "Bad ParentVNI");
-
- // This is a complex mapped value. There may be multiple defs, and we may need
- // to create phi-defs.
- if (simple) *simple = false;
MachineBasicBlock *IdxMBB = LIS.getMBBFromIndex(Idx);
assert(IdxMBB && "No MBB at Idx");
// Is there a def in the same MBB we can extend?
- if (VNInfo *VNI = LI->extendInBlock(LIS.getMBBStartIdx(IdxMBB), Idx))
- return VNI;
+ if (LI->extendInBlock(LIS.getMBBStartIdx(IdxMBB), Idx))
+ return;
// Now for the fun part. We know that ParentVNI potentially has multiple defs,
// and we may need to create even more phi-defs to preserve VNInfo SSA form.
@@ -395,7 +388,6 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
// Since we went through the trouble of a full BFS visiting all reaching defs,
// the values in LiveIn are now accurate. No more phi-defs are needed
// for these blocks, so we can color the live ranges.
- // This makes the next mapValue call much faster.
for (unsigned i = 0, e = LiveIn.size(); i != e; ++i) {
MachineBasicBlock *MBB = LiveIn[i]->getBlock();
SlotIndex Start = LIS.getMBBStartIdx(MBB);
@@ -408,8 +400,6 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
else
LI->addRange(LiveRange(Start, LIS.getMBBEndIdx(MBB), VNI));
}
-
- return IdxVNI;
}
#ifndef NDEBUG
@@ -681,8 +671,8 @@ void SplitEditor::overlapIntv(SlotIndex Start, SlotIndex End) {
assert(LIS.getMBBFromIndex(Start) == LIS.getMBBFromIndex(End) &&
"Range cannot span basic blocks");
- // Treat this as useIntv() for now. The complement interval will be extended
- // as needed by mapValue().
+ // Treat this as useIntv() for now.
+ // The complement interval will be extended as needed by extendRange().
DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):");
RegAssign.insert(Start, End, OpenIdx);
DEBUG(dump());
@@ -726,8 +716,7 @@ void SplitEditor::rewriteAssigned() {
<< Idx << ':' << RegIdx << '\t' << *MI);
// Extend liveness to Idx.
- const VNInfo *ParentVNI = Edit.getParent().getVNInfoAt(Idx);
- LIMappers[RegIdx].mapValue(ParentVNI, Idx);
+ LIMappers[RegIdx].extendRange(Idx);
}
}
@@ -780,7 +769,7 @@ void SplitEditor::finish() {
// FIXME: Don't recompute the liveness of all values, infer it from the
// overlaps between the parent live interval and RegAssign.
- // The mapValue algorithm is only necessary when:
+ // The extendRange algorithm is only necessary when:
// - The parent value maps to multiple defs, and new phis are needed, or
// - The value has been rematerialized before some uses, and we want to
// minimize the live range so it only reaches the remaining uses.
@@ -808,7 +797,7 @@ void SplitEditor::finish() {
DEBUG(dbgs() << " has parent valno #" << VNI->id << " live out\n");
assert(RegAssign.lookup(End) == RegIdx &&
"Different register assignment in phi predecessor");
- LIM.mapValue(VNI, End);
+ LIM.extendRange(End);
}
else
DEBUG(dbgs() << " is not live-out\n");