Fix an issue where the presence of debug info could disable a peephole
optimization in optimizeCompareInstr due to canInstrSubstituteCmpInstr
returning the wrong result.
Depends on D78137.
Differential D78151
[AArch64InstrInfo] Ignore debug insts in canInstrSubstituteCmpInstr [5/10] Authored by vsk on Apr 14 2020, 1:44 PM.
Details Fix an issue where the presence of debug info could disable a peephole Depends on D78137.
Diff Detail
Event Timeline
Comment Actions LGTM, thanks
| ||||||||||||||||||||||||
It seems like a few similar changes popped up recently. It might be worth making it a bit easier to iterate over a range of MIs while skipping debug instructions automatically. It's quite easy to construct iterator ranges that skip debug instructions (see snippet below). It might be worth adding a helpers like that. They could also naturally be used for the existing skipDebugInstructionsBackward/skipDebugInstructionsForward
+ auto MIsWithoutDbg = + make_filter_range(make_range(std::next(CmpInstr->getIterator()), + CmpInstr->getParent()->instr_end()), + [](MachineInstr &I) { return !I.isDebugInstr(); }); + for (const MachineInstr &Instr : MIsWithoutDbg) {