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 | d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf (patch) | |
tree | b6566861c4f7a3d8435cb868c26c9b3706d4119f /lib | |
parent | fcce70ad527cec1fc10b855ee072efb562a2521e (diff) | |
download | llvm-d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf.tar.gz llvm-d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf.tar.bz2 llvm-d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMBaseInstrInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index 6005054271..b530515cdd 100644 --- a/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/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. |