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
This commit is contained in:
Bill Wendling
2010-09-10 21:55:43 +00:00
parent 51f5b67395
commit 220e240bdf
4 changed files with 22 additions and 12 deletions

View File

@@ -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;
}