mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-16 08:29:43 +00:00
Speed up LiveIntervalUnion::unify by handling end insertion specially.
This particularly helps with the initial transfer of fixed intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129277 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bd1926dfd4
commit
11983cd861
@ -35,12 +35,20 @@ void LiveIntervalUnion::unify(LiveInterval &VirtReg) {
|
||||
LiveInterval::iterator RegEnd = VirtReg.end();
|
||||
SegmentIter SegPos = Segments.find(RegPos->start);
|
||||
|
||||
for (;;) {
|
||||
while (SegPos.valid()) {
|
||||
SegPos.insert(RegPos->start, RegPos->end, &VirtReg);
|
||||
if (++RegPos == RegEnd)
|
||||
return;
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user