summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2013-06-05 14:59:36 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2013-06-05 14:59:36 +0000
commite937592ef214e084e728702bd44ee25e7ce076f4 (patch)
treea410d1e1e70fe678fd74c1de30c6b3d431f520ea /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
parenta3dd4899e8ffffa8cceee2ae1ad9eda0fd172f62 (diff)
downloadbcm5719-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.cpp2
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.
OpenPOWER on IntegriCloud