summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-11-17 08:06:50 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-11-17 08:06:50 +0000
commit655364797e0e8234fbf633816308808674cf003c (patch)
tree75b5f16f19957963524a025cbae3ce614b55d79a /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
parent300fa45d8bef2440d47cb797bfc692137d441578 (diff)
downloadbcm5719-llvm-655364797e0e8234fbf633816308808674cf003c.tar.gz
bcm5719-llvm-655364797e0e8234fbf633816308808674cf003c.zip
Simplify code that toggle optional operand to ARM::CPSR.
llvm-svn: 119484
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 89b21027336..c743628df4e 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -1546,9 +1546,9 @@ OptimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, int CmpMask,
case ARM::SUBri:
case ARM::t2ADDri:
case ARM::t2SUBri:
- MI->RemoveOperand(5);
- MachineInstrBuilder(MI)
- .addReg(ARM::CPSR, RegState::Define | RegState::Implicit);
+ // Toggle the optional operand to CPSR.
+ MI->getOperand(5).setReg(ARM::CPSR);
+ MI->getOperand(5).setIsDef(true);
CmpInstr->eraseFromParent();
return true;
}
OpenPOWER on IntegriCloud