/// the comparison into one that sets the zero bit in the flags
/// register. Update the iterator *only* if a transformation took place.
virtual bool ConvertToSetZeroFlag(MachineInstr * /*CmpInstr*/,
+ unsigned /*SrcReg*/, int /*CmpValue*/,
MachineBasicBlock::iterator &) const {
return false;
}
return false;
// Attempt to convert the defining instruction to set the "zero" flag.
- if (TII->ConvertToSetZeroFlag(MI, NextIter)) {
+ if (TII->ConvertToSetZeroFlag(MI, SrcReg, CmpValue, NextIter)) {
++NumEliminated;
return true;
}
/// comparison into one that sets the zero bit in the flags register. Update the
/// iterator *only* if a transformation took place.
bool ARMBaseInstrInfo::
-ConvertToSetZeroFlag(MachineInstr *CmpInstr,
+ConvertToSetZeroFlag(MachineInstr *CmpInstr, unsigned SrcReg, int CmpValue,
MachineBasicBlock::iterator &MII) const {
- unsigned SrcReg;
- int CmpValue;
- if (!AnalyzeCompare(CmpInstr, SrcReg, CmpValue) || CmpValue != 0)
+ if (CmpValue != 0)
return false;
MachineRegisterInfo &MRI = CmpInstr->getParent()->getParent()->getRegInfo();
/// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so
/// that we can remove a "comparison with zero".
- virtual bool ConvertToSetZeroFlag(MachineInstr *CmpInstr,
+ virtual bool ConvertToSetZeroFlag(MachineInstr *CmpInstr, unsigned SrcReg,
+ int CmpValue,
MachineBasicBlock::iterator &MII) const;
virtual unsigned getNumMicroOps(const MachineInstr *MI,