diff options
| author | Diana Picus <diana.picus@linaro.org> | 2017-01-13 10:37:37 +0000 |
|---|---|---|
| committer | Diana Picus <diana.picus@linaro.org> | 2017-01-13 10:37:37 +0000 |
| commit | a2c59149e14b52b613a5403302cf84d6ab0456d0 (patch) | |
| tree | f7470e3585f1228eb055e2ebcef28908bef10351 /llvm/lib/Target/ARM/ARMBaseInstrInfo.h | |
| parent | 8a73f5562f9e7ce0c9416fbd0d8d2dc8f1807898 (diff) | |
| download | bcm5719-llvm-a2c59149e14b52b613a5403302cf84d6ab0456d0.tar.gz bcm5719-llvm-a2c59149e14b52b613a5403302cf84d6ab0456d0.zip | |
[ARM] CodeGen: Replace AddDefaultT1CC and AddNoT1CC. NFC
For AddDefaultT1CC, we add a new helper t1CondCodeOp, which creates the
appropriate register operand. For AddNoT1CC, we use the existing condCodeOp
helper - we only had two uses of AddNoT1CC, so at this point it's probably not
worth having yet another helper just for them.
Differential Revision: https://reviews.llvm.org/D28603
llvm-svn: 291894
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.h')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMBaseInstrInfo.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h index 0e1cb5c87b7..a02c66ee9e2 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h @@ -416,17 +416,13 @@ static inline MachineOperand condCodeOp(unsigned CCReg = 0) { return MachineOperand::CreateReg(CCReg, 0); } -// FIXME: Replace with something that returns a MachineOperand directly. -static inline -const MachineInstrBuilder &AddDefaultT1CC(const MachineInstrBuilder &MIB, - bool isDead = false) { - return MIB.addReg(ARM::CPSR, getDefRegState(true) | getDeadRegState(isDead)); -} - -// FIXME: Replace with something that returns a MachineOperand -static inline -const MachineInstrBuilder &AddNoT1CC(const MachineInstrBuilder &MIB) { - return MIB.addReg(0); +/// Get the operand corresponding to the conditional code result for Thumb1. +/// This operand will always refer to CPSR and it will have the Define flag set. +/// You can optionally set the Dead flag by means of \p isDead. +static inline MachineOperand t1CondCodeOp(bool isDead = false) { + return MachineOperand::CreateReg(ARM::CPSR, + /*Define*/ true, /*Implicit*/ false, + /*Kill*/ false, isDead); } static inline |

