summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-05 17:15:43 +0000
committerOwen Anderson <resistor@mac.com>2008-06-05 17:15:43 +0000
commit35e2dfe1cfb86f9be75c1ac7bdc6050b0b46b1fe (patch)
treed2b5bf9e5ef5e25d936d4641e899d52386da3e7a /llvm/lib
parentb0ec18bd81705f3b10eb7e584416daf16ada6ab4 (diff)
downloadbcm5719-llvm-35e2dfe1cfb86f9be75c1ac7bdc6050b0b46b1fe.tar.gz
bcm5719-llvm-35e2dfe1cfb86f9be75c1ac7bdc6050b0b46b1fe.zip
Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
llvm-svn: 52012
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index f184191b937..053e4d272f8 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1830,3 +1830,18 @@ void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li,
}
}
}
+
+LiveRange LiveIntervals::addLiveRangeToEndOfBlock(unsigned reg,
+ MachineInstr* startInst) {
+ LiveInterval& Interval = getOrCreateInterval(reg);
+ VNInfo* VN = Interval.getNextValue(
+ getInstructionIndex(startInst) + InstrSlots::DEF,
+ startInst, getVNInfoAllocator());
+ VN->hasPHIKill = true;
+ VN->kills.push_back(getMBBEndIdx(startInst->getParent()));
+ LiveRange LR(getInstructionIndex(startInst) + InstrSlots::DEF,
+ getMBBEndIdx(startInst->getParent()) + 1, VN);
+ Interval.addRange(LR);
+
+ return LR;
+}
OpenPOWER on IntegriCloud