mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
No need to recompute the SrcReg and CmpValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113666 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
92ad57f066
commit
3665661a57
@ -589,6 +589,7 @@ public:
|
|||||||
/// the comparison into one that sets the zero bit in the flags
|
/// the comparison into one that sets the zero bit in the flags
|
||||||
/// register. Update the iterator *only* if a transformation took place.
|
/// register. Update the iterator *only* if a transformation took place.
|
||||||
virtual bool ConvertToSetZeroFlag(MachineInstr * /*CmpInstr*/,
|
virtual bool ConvertToSetZeroFlag(MachineInstr * /*CmpInstr*/,
|
||||||
|
unsigned /*SrcReg*/, int /*CmpValue*/,
|
||||||
MachineBasicBlock::iterator &) const {
|
MachineBasicBlock::iterator &) const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ bool PeepholeOptimizer::OptimizeCmpInstr(MachineInstr *MI,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Attempt to convert the defining instruction to set the "zero" flag.
|
// Attempt to convert the defining instruction to set the "zero" flag.
|
||||||
if (TII->ConvertToSetZeroFlag(MI, NextIter)) {
|
if (TII->ConvertToSetZeroFlag(MI, SrcReg, CmpValue, NextIter)) {
|
||||||
++NumEliminated;
|
++NumEliminated;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1381,11 +1381,9 @@ AnalyzeCompare(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const {
|
|||||||
/// comparison into one that sets the zero bit in the flags register. Update the
|
/// comparison into one that sets the zero bit in the flags register. Update the
|
||||||
/// iterator *only* if a transformation took place.
|
/// iterator *only* if a transformation took place.
|
||||||
bool ARMBaseInstrInfo::
|
bool ARMBaseInstrInfo::
|
||||||
ConvertToSetZeroFlag(MachineInstr *CmpInstr,
|
ConvertToSetZeroFlag(MachineInstr *CmpInstr, unsigned SrcReg, int CmpValue,
|
||||||
MachineBasicBlock::iterator &MII) const {
|
MachineBasicBlock::iterator &MII) const {
|
||||||
unsigned SrcReg;
|
if (CmpValue != 0)
|
||||||
int CmpValue;
|
|
||||||
if (!AnalyzeCompare(CmpInstr, SrcReg, CmpValue) || CmpValue != 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MachineRegisterInfo &MRI = CmpInstr->getParent()->getParent()->getRegInfo();
|
MachineRegisterInfo &MRI = CmpInstr->getParent()->getParent()->getRegInfo();
|
||||||
|
@ -346,7 +346,8 @@ public:
|
|||||||
|
|
||||||
/// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so
|
/// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so
|
||||||
/// that we can remove a "comparison with zero".
|
/// 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;
|
MachineBasicBlock::iterator &MII) const;
|
||||||
|
|
||||||
virtual unsigned getNumMicroOps(const MachineInstr *MI,
|
virtual unsigned getNumMicroOps(const MachineInstr *MI,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user