mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Cleanup the main RegisterCoalescer loop.
Block priorities still apply outside loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167793 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2001,30 +2001,17 @@ void RegisterCoalescer::joinAllIntervals() {
|
|||||||
DEBUG(dbgs() << "********** JOINING INTERVALS ***********\n");
|
DEBUG(dbgs() << "********** JOINING INTERVALS ***********\n");
|
||||||
assert(WorkList.empty() && "Old data still around.");
|
assert(WorkList.empty() && "Old data still around.");
|
||||||
|
|
||||||
if (Loops->empty()) {
|
std::vector<MBBPriorityInfo> MBBs;
|
||||||
// If there are no loops in the function, join intervals in function order.
|
for (MachineFunction::iterator I = MF->begin(), E = MF->end();I != E;++I){
|
||||||
for (MachineFunction::iterator I = MF->begin(), E = MF->end();
|
MachineBasicBlock *MBB = I;
|
||||||
I != E; ++I)
|
MBBs.push_back(MBBPriorityInfo(MBB, Loops->getLoopDepth(MBB),
|
||||||
copyCoalesceInMBB(I);
|
isSplitEdge(MBB)));
|
||||||
} else {
|
|
||||||
// Otherwise, join intervals in inner loops before other intervals.
|
|
||||||
// Unfortunately we can't just iterate over loop hierarchy here because
|
|
||||||
// there may be more MBB's than BB's. Collect MBB's for sorting.
|
|
||||||
|
|
||||||
// Join intervals in the function prolog first. We want to join physical
|
|
||||||
// registers with virtual registers before the intervals got too long.
|
|
||||||
std::vector<MBBPriorityInfo> MBBs;
|
|
||||||
for (MachineFunction::iterator I = MF->begin(), E = MF->end();I != E;++I){
|
|
||||||
MachineBasicBlock *MBB = I;
|
|
||||||
MBBs.push_back(MBBPriorityInfo(MBB, Loops->getLoopDepth(MBB),
|
|
||||||
isSplitEdge(MBB)));
|
|
||||||
}
|
|
||||||
std::sort(MBBs.begin(), MBBs.end(), MBBPriorityCompare());
|
|
||||||
|
|
||||||
// Finally, join intervals in loop nest order.
|
|
||||||
for (unsigned i = 0, e = MBBs.size(); i != e; ++i)
|
|
||||||
copyCoalesceInMBB(MBBs[i].MBB);
|
|
||||||
}
|
}
|
||||||
|
std::sort(MBBs.begin(), MBBs.end(), MBBPriorityCompare());
|
||||||
|
|
||||||
|
// Coalesce intervals in MBB priority order.
|
||||||
|
for (unsigned i = 0, e = MBBs.size(); i != e; ++i)
|
||||||
|
copyCoalesceInMBB(MBBs[i].MBB);
|
||||||
|
|
||||||
// Joining intervals can allow other intervals to be joined. Iteratively join
|
// Joining intervals can allow other intervals to be joined. Iteratively join
|
||||||
// until we make no progress.
|
// until we make no progress.
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ if.end: ; preds = %entry, %if.then
|
|||||||
; CHECK: vmov.f32 {{.*}}, #1.0
|
; CHECK: vmov.f32 {{.*}}, #1.0
|
||||||
; CHECK-NOT: vmov
|
; CHECK-NOT: vmov
|
||||||
; CHECK-NOT: vorr
|
; CHECK-NOT: vorr
|
||||||
; CHECK: %if.end
|
; CHECK: bx
|
||||||
; We may leave the last insertelement in the if.end block.
|
; We may leave the last insertelement in the if.end block.
|
||||||
; It is inserting the %add value into a dead lane, but %add causes interference
|
; It is inserting the %add value into a dead lane, but %add causes interference
|
||||||
; in the entry block, and we don't do dead lane checks across basic blocks.
|
; in the entry block, and we don't do dead lane checks across basic blocks.
|
||||||
|
|||||||
Reference in New Issue
Block a user