summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalUnion.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-10 01:12:59 +0000
committerMatthias Braun <matze@braunis.de>2014-12-10 01:12:59 +0000
commita0f0c1f013df5fe2ec7fe5f6bc4753b75fbf1907 (patch)
tree33d235c8789c2e14fb96a2b1d30ba6f2beca573e /llvm/lib/CodeGen/LiveIntervalUnion.cpp
parent755f8b188500c839ccb29287c5e06de3503d0356 (diff)
downloadbcm5719-llvm-a0f0c1f013df5fe2ec7fe5f6bc4753b75fbf1907.tar.gz
bcm5719-llvm-a0f0c1f013df5fe2ec7fe5f6bc4753b75fbf1907.zip
LiveIntervalUnion: Allow specification of liverange when unifying/extracting.
This allows it to add subregister ranges into the union. llvm-svn: 223890
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalUnion.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.cpp b/llvm/lib/CodeGen/LiveIntervalUnion.cpp
index d81221b6a52..025d99ce788 100644
--- a/llvm/lib/CodeGen/LiveIntervalUnion.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalUnion.cpp
@@ -26,14 +26,14 @@ using namespace llvm;
// Merge a LiveInterval's segments. Guarantee no overlaps.
-void LiveIntervalUnion::unify(LiveInterval &VirtReg) {
- if (VirtReg.empty())
+void LiveIntervalUnion::unify(LiveInterval &VirtReg, const LiveRange &Range) {
+ if (Range.empty())
return;
++Tag;
// Insert each of the virtual register's live segments into the map.
- LiveInterval::iterator RegPos = VirtReg.begin();
- LiveInterval::iterator RegEnd = VirtReg.end();
+ LiveRange::const_iterator RegPos = Range.begin();
+ LiveRange::const_iterator RegEnd = Range.end();
SegmentIter SegPos = Segments.find(RegPos->start);
while (SegPos.valid()) {
@@ -53,14 +53,14 @@ void LiveIntervalUnion::unify(LiveInterval &VirtReg) {
}
// Remove a live virtual register's segments from this union.
-void LiveIntervalUnion::extract(LiveInterval &VirtReg) {
- if (VirtReg.empty())
+void LiveIntervalUnion::extract(LiveInterval &VirtReg, const LiveRange &Range) {
+ if (Range.empty())
return;
++Tag;
// Remove each of the virtual register's live segments from the map.
- LiveInterval::iterator RegPos = VirtReg.begin();
- LiveInterval::iterator RegEnd = VirtReg.end();
+ LiveRange::const_iterator RegPos = Range.begin();
+ LiveRange::const_iterator RegEnd = Range.end();
SegmentIter SegPos = Segments.find(RegPos->start);
for (;;) {
@@ -70,7 +70,7 @@ void LiveIntervalUnion::extract(LiveInterval &VirtReg) {
return;
// Skip all segments that may have been coalesced.
- RegPos = VirtReg.advanceTo(RegPos, SegPos.start());
+ RegPos = Range.advanceTo(RegPos, SegPos.start());
if (RegPos == RegEnd)
return;
OpenPOWER on IntegriCloud