Handle ARM compares as well as converting for ARM adds, subs, and thumb2's adds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2010-08-11 00:23:00 +00:00
parent 0cce3dd326
commit 38ae997e63

View File

@ -1358,6 +1358,8 @@ bool ARMBaseInstrInfo::
AnalyzeCompare(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const {
switch (MI->getOpcode()) {
default: break;
case ARM::CMPri:
case ARM::CMPzri:
case ARM::t2CMPri:
case ARM::t2CMPzri:
SrcReg = MI->getOperand(0).getReg();
@ -1398,6 +1400,9 @@ ConvertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const {
// Set the "zero" bit in CPSR.
switch (MI->getOpcode()) {
default: break;
case ARM::ADDri:
case ARM::SUBri:
case ARM::t2ADDri:
case ARM::t2SUBri: {
MI->RemoveOperand(5);
MachineInstrBuilder MB(MI);