mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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
This commit is contained in:
@@ -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.
|
||||||
|
Reference in New Issue
Block a user