diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-05 14:59:36 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-05 14:59:36 +0000 |
commit | e937592ef214e084e728702bd44ee25e7ce076f4 (patch) | |
tree | a410d1e1e70fe678fd74c1de30c6b3d431f520ea /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | |
parent | a3dd4899e8ffffa8cceee2ae1ad9eda0fd172f62 (diff) | |
download | bcm5719-llvm-e937592ef214e084e728702bd44ee25e7ce076f4.tar.gz bcm5719-llvm-e937592ef214e084e728702bd44ee25e7ce076f4.zip |
ARMInstrInfo: Improve isSwiftFastImmShift
An instruction with less than 3 inputs is trivially a fast immediate shift.
Reapply of 183256, should not have caused the tablegen segfault on linux either.
llvm-svn: 183314
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index 60050542716..b530515cdd8 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -4152,6 +4152,8 @@ bool ARMBaseInstrInfo::hasNOP() const { } bool ARMBaseInstrInfo::isSwiftFastImmShift(const MachineInstr *MI) const { + if (MI->getNumOperands() < 4) + return true; unsigned ShOpVal = MI->getOperand(3).getImm(); unsigned ShImm = ARM_AM::getSORegOffset(ShOpVal); // Swift supports faster shifts for: lsl 2, lsl 1, and lsr 1. |