mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Revert previous patch until I get a bug fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14853 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -147,9 +147,6 @@ bool LoopSimplify::ProcessLoop(Loop *L) {
|
|||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DominatorSet &DS = getAnalysis<DominatorSet>(); // Update dominator info
|
|
||||||
|
|
||||||
// Next, check to make sure that all exit nodes of the loop only have
|
// Next, check to make sure that all exit nodes of the loop only have
|
||||||
// predecessors that are inside of the loop. This check guarantees that the
|
// predecessors that are inside of the loop. This check guarantees that the
|
||||||
// loop preheader/header will dominate the exit blocks. If the exit block has
|
// loop preheader/header will dominate the exit blocks. If the exit block has
|
||||||
@@ -158,16 +155,19 @@ bool LoopSimplify::ProcessLoop(Loop *L) {
|
|||||||
L->getExitBlocks(ExitBlocks);
|
L->getExitBlocks(ExitBlocks);
|
||||||
for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
|
for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) {
|
||||||
BasicBlock *ExitBlock = ExitBlocks[i];
|
BasicBlock *ExitBlock = ExitBlocks[i];
|
||||||
if (!DS.dominates(L->getHeader(), ExitBlock)) {
|
for (pred_iterator PI = pred_begin(ExitBlock), PE = pred_end(ExitBlock);
|
||||||
BasicBlock *NewBB = RewriteLoopExitBlock(L, ExitBlock);
|
PI != PE; ++PI)
|
||||||
for (unsigned j = i; j != ExitBlocks.size(); ++j)
|
if (!L->contains(*PI)) {
|
||||||
if (ExitBlocks[j] == ExitBlock)
|
BasicBlock *NewBB = RewriteLoopExitBlock(L, ExitBlock);
|
||||||
ExitBlocks[j] = NewBB;
|
for (unsigned j = i; j != ExitBlocks.size(); ++j)
|
||||||
|
if (ExitBlocks[j] == ExitBlock)
|
||||||
NumInserted++;
|
ExitBlocks[j] = NewBB;
|
||||||
Changed = true;
|
|
||||||
|
NumInserted++;
|
||||||
|
Changed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If the header has more than two predecessors at this point (from the
|
// If the header has more than two predecessors at this point (from the
|
||||||
// preheader and from multiple backedges), we must adjust the loop.
|
// preheader and from multiple backedges), we must adjust the loop.
|
||||||
|
Reference in New Issue
Block a user