From 220e240bdf3235252c2a1fc8fcc5d4b8e8117918 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 10 Sep 2010 21:55:43 +0000 Subject: Modify the comparison optimizations in the peephole optimizer to update the iterator when an optimization took place. This allows us to do more insane things with the code than just remove an instruction or two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113640 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetInstrInfo.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 844b965..f465201 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -586,9 +586,11 @@ public: } /// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so - /// that we can remove a "comparison with zero". - virtual bool ConvertToSetZeroFlag(MachineInstr *Instr, - MachineInstr *CmpInstr) const { + /// that we can remove a "comparison with zero". Update the iterator *only* + /// if a transformation took place. + virtual bool ConvertToSetZeroFlag(MachineInstr * /*Instr*/, + MachineInstr * /*CmpInstr*/, + MachineBasicBlock::iterator &) const { return false; } -- cgit v1.1