[llvm] r183256 - ARMInstrInfo: Improve isSwiftFastImmShift
Arnold Schwaighofer
aschwaighofer at apple.com
Tue Jun 4 15:15:43 PDT 2013
Author: arnolds
Date: Tue Jun 4 17:15:43 2013
New Revision: 183256
URL: http://llvm.org/viewvc/llvm-project?rev=183256&view=rev
Log:
ARMInstrInfo: Improve isSwiftFastImmShift
An instruction with less than 3 inputs is trivially a fast immediate shift.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=183256&r1=183255&r2=183256&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Tue Jun 4 17:15:43 2013
@@ -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.
More information about the llvm-commits
mailing list