summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMBaseInstrInfo.h
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2012-06-29 21:33:59 +0000
committerManman Ren <mren@apple.com>2012-06-29 21:33:59 +0000
commitde7266c611b37ec050efb53b73166081a98cea13 (patch)
treed90f453d9a154f18a666a068c6a9c78860514cf3 /lib/Target/ARM/ARMBaseInstrInfo.h
parent8ccaad526abdf39141b11b6d480b027d73a2d2a8 (diff)
downloadllvm-de7266c611b37ec050efb53b73166081a98cea13.tar.gz
llvm-de7266c611b37ec050efb53b73166081a98cea13.tar.bz2
llvm-de7266c611b37ec050efb53b73166081a98cea13.tar.xz
Add SrcReg2 to analyzeCompare and optimizeCompareInstr to handle Compare
instructions with two register operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMBaseInstrInfo.h')
-rw-r--r--lib/Target/ARM/ARMBaseInstrInfo.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.h b/lib/Target/ARM/ARMBaseInstrInfo.h
index 8217f239d1..1a10a4ab1c 100644
--- a/lib/Target/ARM/ARMBaseInstrInfo.h
+++ b/lib/Target/ARM/ARMBaseInstrInfo.h
@@ -186,16 +186,20 @@ public:
return NumCycles == 1;
}
- /// AnalyzeCompare - For a comparison instruction, return the source register
- /// 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 &CmpMask, int &CmpValue) const;
-
- /// OptimizeCompareInstr - Convert the instruction to set the zero flag so
- /// that we can remove a "comparison with zero".
- virtual bool OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg,
- int CmpMask, int CmpValue,
+ /// analyzeCompare - For a comparison instruction, return the source registers
+ /// in SrcReg and SrcReg2 if having two register operands, 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,
+ unsigned &SrcReg2, int &CmpMask,
+ int &CmpValue) const;
+
+ /// optimizeCompareInstr - Convert the instruction to set the zero flag so
+ /// that we can remove a "comparison with zero"; Remove a redundant CMP
+ /// instruction if the flags can be updated in the same way by an earlier
+ /// instruction such as SUB.
+ virtual bool optimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg,
+ unsigned SrcReg2, int CmpMask, int CmpValue,
const MachineRegisterInfo *MRI) const;
/// FoldImmediate - 'Reg' is known to be defined by a move immediate