mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-14 15:25:25 +00:00
Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor. Sometimes a block may be listed more than once, and processing it more than once in this loop can lead to inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not clear these values. There's no point in continuing the loop regardless. The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -155,10 +155,10 @@ bool CodePlacementOpt::OptimizeIntraLoopEdges() {
|
||||
// A fallthrough.
|
||||
FtMBB = PredMBB;
|
||||
MachineLoop *PL = MLI->getLoopFor(PredMBB);
|
||||
if (PL && (PL == L || PL->getLoopDepth() >= L->getLoopDepth())) {
|
||||
if (PL && (PL == L || PL->getLoopDepth() >= L->getLoopDepth()))
|
||||
OkToMove = false;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user