From: Arnold Schwaighofer Date: Wed, 5 Jun 2013 14:59:36 +0000 (+0000) Subject: ARMInstrInfo: Improve isSwiftFastImmShift X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d87bd5627e5b78cb556d6c7b5aa76ae3d55d8acf;p=oota-llvm.git 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 --- diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index 60050542716..b530515cdd8 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.