Move the search for the appropriate AND instruction

into OptimizeCompareInstr.
This necessitates the passing of CmpValue around,
so widen the virtual functions to accomodate.

No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114428 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif
2010-09-21 12:01:15 +00:00
parent b4c7a12aea
commit 04ac81d5db
4 changed files with 50 additions and 26 deletions

View File

@@ -581,7 +581,7 @@ public:
/// in SrcReg and the value it compares against in CmpValue. Return true if
/// the comparison instruction can be analyzed.
virtual bool AnalyzeCompare(const MachineInstr *MI,
unsigned &SrcReg, int &CmpValue) const {
unsigned &SrcReg, int &Mask, int &Value) const {
return false;
}
@@ -589,8 +589,8 @@ public:
/// into something more efficient. E.g., on ARM most instructions can set the
/// flags register, obviating the need for a separate CMP. Update the iterator
/// *only* if a transformation took place.
virtual bool OptimizeCompareInstr(MachineInstr * /*CmpInstr*/,
unsigned /*SrcReg*/, int /*CmpValue*/,
virtual bool OptimizeCompareInstr(MachineInstr *CmpInstr,
unsigned SrcReg, int Mask, int Value,
MachineBasicBlock::iterator &) const {
return false;
}