diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-04 22:15:43 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-06-04 22:15:43 +0000 |
commit | 279c0aff1a47663b3c751117e80406d410d3e81c (patch) | |
tree | 596ad59f233895c85e9c741895ad63bd58411057 /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | |
parent | afe7d5c8f5980b78f9c93f64c5b91bc633f54769 (diff) | |
download | bcm5719-llvm-279c0aff1a47663b3c751117e80406d410d3e81c.tar.gz bcm5719-llvm-279c0aff1a47663b3c751117e80406d410d3e81c.zip |
ARMInstrInfo: Improve isSwiftFastImmShift
An instruction with less than 3 inputs is trivially a fast immediate shift.
llvm-svn: 183256
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. |