mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
RecursivelyDeleteTriviallyDeadInstructions() could remove
more than 1 instruction. The caller need to be aware of this and adjust instruction iterators accordingly. rdar://16679376 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207302 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -127,7 +127,15 @@ bool LoopInstSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||
++NumSimplified;
|
||||
}
|
||||
}
|
||||
LocalChanged |= RecursivelyDeleteTriviallyDeadInstructions(I, TLI);
|
||||
bool res = RecursivelyDeleteTriviallyDeadInstructions(I, TLI);
|
||||
if (res) {
|
||||
// RecursivelyDeleteTriviallyDeadInstruction can remove
|
||||
// more than one instruction, so simply incrementing the
|
||||
// iterator does not work. When instructions get deleted
|
||||
// re-iterate instead.
|
||||
BI = BB->begin(); BE = BB->end();
|
||||
LocalChanged |= res;
|
||||
}
|
||||
|
||||
if (IsSubloopHeader && !isa<PHINode>(I))
|
||||
break;
|
||||
|
Reference in New Issue
Block a user