mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Rename ConvertToSetZeroFlag to something more general.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113670 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -585,10 +585,11 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ConvertToSetZeroFlag - Convert the instruction supplying the argument to
|
/// OptimizeCompareInstr - See if the comparison instruction can be converted
|
||||||
/// the comparison into one that sets the zero bit in the flags
|
/// into something more efficient. E.g., on ARM most instructions can set the
|
||||||
/// register. Update the iterator *only* if a transformation took place.
|
/// flags register, obviating the need for a separate CMP. Update the iterator
|
||||||
virtual bool ConvertToSetZeroFlag(MachineInstr * /*CmpInstr*/,
|
/// *only* if a transformation took place.
|
||||||
|
virtual bool OptimizeCompareInstr(MachineInstr * /*CmpInstr*/,
|
||||||
unsigned /*SrcReg*/, int /*CmpValue*/,
|
unsigned /*SrcReg*/, int /*CmpValue*/,
|
||||||
MachineBasicBlock::iterator &) const {
|
MachineBasicBlock::iterator &) const {
|
||||||
return false;
|
return false;
|
||||||
|
@@ -243,8 +243,8 @@ bool PeepholeOptimizer::OptimizeCmpInstr(MachineInstr *MI,
|
|||||||
TargetRegisterInfo::isPhysicalRegister(SrcReg))
|
TargetRegisterInfo::isPhysicalRegister(SrcReg))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Attempt to convert the defining instruction to set the "zero" flag.
|
// Attempt to optimize the comparison instruction.
|
||||||
if (TII->ConvertToSetZeroFlag(MI, SrcReg, CmpValue, NextIter)) {
|
if (TII->OptimizeCompareInstr(MI, SrcReg, CmpValue, NextIter)) {
|
||||||
++NumEliminated;
|
++NumEliminated;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -1377,11 +1377,11 @@ AnalyzeCompare(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ConvertToSetZeroFlag - Convert the instruction supplying the argument to the
|
/// OptimizeCompareInstr - Convert the instruction supplying the argument to the
|
||||||
/// 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, unsigned SrcReg, int CmpValue,
|
OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpValue,
|
||||||
MachineBasicBlock::iterator &MII) const {
|
MachineBasicBlock::iterator &MII) const {
|
||||||
if (CmpValue != 0)
|
if (CmpValue != 0)
|
||||||
return false;
|
return false;
|
||||||
|
@@ -344,9 +344,9 @@ public:
|
|||||||
virtual bool AnalyzeCompare(const MachineInstr *MI, unsigned &SrcReg,
|
virtual bool AnalyzeCompare(const MachineInstr *MI, unsigned &SrcReg,
|
||||||
int &CmpValue) const;
|
int &CmpValue) const;
|
||||||
|
|
||||||
/// ConvertToSetZeroFlag - Convert the instruction to set the zero flag so
|
/// OptimizeCompareInstr - 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, unsigned SrcReg,
|
virtual bool OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg,
|
||||||
int CmpValue,
|
int CmpValue,
|
||||||
MachineBasicBlock::iterator &MII) const;
|
MachineBasicBlock::iterator &MII) const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user