mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Make sure we iterate over newly created instructions. Fixes pr13625. Testcase to
follow in one sec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165951 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -527,6 +527,11 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
SeenMoveImm = true;
|
SeenMoveImm = true;
|
||||||
} else {
|
} else {
|
||||||
Changed |= optimizeExtInstr(MI, MBB, LocalMIs);
|
Changed |= optimizeExtInstr(MI, MBB, LocalMIs);
|
||||||
|
// optimizeExtInstr might have created new instructions after MI
|
||||||
|
// and before the already incremented MII. Adjust MII so that the
|
||||||
|
// next iteration sees the new instructions.
|
||||||
|
MII = MI;
|
||||||
|
++MII;
|
||||||
if (SeenMoveImm)
|
if (SeenMoveImm)
|
||||||
Changed |= foldImmediate(MI, MBB, ImmDefRegs, ImmDefMIs);
|
Changed |= foldImmediate(MI, MBB, ImmDefRegs, ImmDefMIs);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user