1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

ARMInstrInfo: Improve isSwiftFastImmShift

An instruction with less than 3 inputs is trivially a fast immediate shift.

llvm-svn: 183256
This commit is contained in:
Arnold Schwaighofer 2013-06-04 22:15:43 +00:00
parent 10d37229fb
commit 81440608f7

View File

@ -4152,6 +4152,8 @@ bool ARMBaseInstrInfo::hasNOP() const {
} }
bool ARMBaseInstrInfo::isSwiftFastImmShift(const MachineInstr *MI) const { bool ARMBaseInstrInfo::isSwiftFastImmShift(const MachineInstr *MI) const {
if (MI->getNumOperands() < 4)
return true;
unsigned ShOpVal = MI->getOperand(3).getImm(); unsigned ShOpVal = MI->getOperand(3).getImm();
unsigned ShImm = ARM_AM::getSORegOffset(ShOpVal); unsigned ShImm = ARM_AM::getSORegOffset(ShOpVal);
// Swift supports faster shifts for: lsl 2, lsl 1, and lsr 1. // Swift supports faster shifts for: lsl 2, lsl 1, and lsr 1.