mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
Move the decision logic whether it's a good idea to split a critical edge to clients. Also fixed an erroneous check. An edge is only a back edge when the from and to blocks are in the same loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111256 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -439,14 +439,6 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
||||
if (TII->AnalyzeBranch(*this, TBB, FBB, Cond))
|
||||
return NULL;
|
||||
|
||||
// Avoid splitting backedges of loops. It would introduce small out-of-line
|
||||
// blocks into the loop which is very bad for code placement.
|
||||
if (this == Succ)
|
||||
return NULL;
|
||||
MachineLoopInfo *MLI = P->getAnalysisIfAvailable<MachineLoopInfo>();
|
||||
if (MLI->isLoopHeader(Succ))
|
||||
return NULL;
|
||||
|
||||
MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock();
|
||||
MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB);
|
||||
DEBUG(dbgs() << "Splitting critical edge:"
|
||||
@@ -479,7 +471,7 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
|
||||
P->getAnalysisIfAvailable<MachineDominatorTree>())
|
||||
MDT->addNewBlock(NMBB, this);
|
||||
|
||||
if (MLI)
|
||||
if (MachineLoopInfo *MLI = P->getAnalysisIfAvailable<MachineLoopInfo>())
|
||||
if (MachineLoop *TIL = MLI->getLoopFor(this)) {
|
||||
// If one or the other blocks were not in a loop, the new block is not
|
||||
// either, and thus LI doesn't need to be updated.
|
||||
|
Reference in New Issue
Block a user