summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-06-02 16:53:25 +0000
committerLang Hames <lhames@gmail.com>2009-06-02 16:53:25 +0000
commitfc968ef687ede038a0c1d130654429862a764217 (patch)
tree71fb9e78c3c51c850228f0d6a578ed14aa7eb669 /llvm/lib/CodeGen/LiveInterval.cpp
parent47b8a8d522200d2a48b55ebc96d69210432ab988 (diff)
downloadbcm5719-llvm-fc968ef687ede038a0c1d130654429862a764217.tar.gz
bcm5719-llvm-fc968ef687ede038a0c1d130654429862a764217.zip
Update to in-place spilling framework. Includes live interval scaling and trivial rewriter.
llvm-svn: 72729
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 9dee892c75e..67120b87988 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -359,6 +359,29 @@ void LiveInterval::removeValNo(VNInfo *ValNo) {
}
}
+/// scaleNumbering - Renumber VNI and ranges to provide gaps for new
+/// instructions.
+void LiveInterval::scaleNumbering(unsigned factor) {
+ // Scale ranges.
+ for (iterator RI = begin(), RE = end(); RI != RE; ++RI) {
+ RI->start = InstrSlots::scale(RI->start, factor);
+ RI->end = InstrSlots::scale(RI->end, factor);
+ }
+
+ // Scale VNI info.
+ for (vni_iterator VNI = vni_begin(), VNIE = vni_end(); VNI != VNIE; ++VNI) {
+ VNInfo *vni = *VNI;
+ if (vni->def != ~0U && vni->def != ~1U) {
+ vni->def = InstrSlots::scale(vni->def, factor);
+ }
+
+ for (unsigned i = 0; i < vni->kills.size(); ++i) {
+ if (vni->kills[i] != 0)
+ vni->kills[i] = InstrSlots::scale(vni->kills[i], factor);
+ }
+ }
+}
+
/// getLiveRangeContaining - Return the live range that contains the
/// specified index, or null if there is none.
LiveInterval::const_iterator
OpenPOWER on IntegriCloud