mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-14 15:38:57 +00:00
Speed up LiveIntervalUnion::unify by handling end insertion specially.
This particularly helps with the initial transfer of fixed intervals. llvm-svn: 129277
This commit is contained in:
parent
97bb6d4c3a
commit
57f2eda288
@ -35,12 +35,20 @@ void LiveIntervalUnion::unify(LiveInterval &VirtReg) {
|
|||||||
LiveInterval::iterator RegEnd = VirtReg.end();
|
LiveInterval::iterator RegEnd = VirtReg.end();
|
||||||
SegmentIter SegPos = Segments.find(RegPos->start);
|
SegmentIter SegPos = Segments.find(RegPos->start);
|
||||||
|
|
||||||
for (;;) {
|
while (SegPos.valid()) {
|
||||||
SegPos.insert(RegPos->start, RegPos->end, &VirtReg);
|
SegPos.insert(RegPos->start, RegPos->end, &VirtReg);
|
||||||
if (++RegPos == RegEnd)
|
if (++RegPos == RegEnd)
|
||||||
return;
|
return;
|
||||||
SegPos.advanceTo(RegPos->start);
|
SegPos.advanceTo(RegPos->start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We have reached the end of Segments, so it is no longer necessary to search
|
||||||
|
// for the insertion position.
|
||||||
|
// It is faster to insert the end first.
|
||||||
|
--RegEnd;
|
||||||
|
SegPos.insert(RegEnd->start, RegEnd->end, &VirtReg);
|
||||||
|
for (; RegPos != RegEnd; ++RegPos, ++SegPos)
|
||||||
|
SegPos.insert(RegPos->start, RegPos->end, &VirtReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a live virtual register's segments from this union.
|
// Remove a live virtual register's segments from this union.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user