diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index c6a59ec44ef80..282a6ee149e50 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -2936,7 +2936,7 @@ bool AArch64InstrInfo::canFoldIntoAddrMode(const MachineInstr &MemI, if (avoidSlowSTRQ(MemI)) return false; } - return canFoldAddRegIntoAddrMode(1 << Shift); + return canFoldAddRegIntoAddrMode(1ULL << Shift); } case AArch64::ADDXrr: @@ -2968,10 +2968,10 @@ bool AArch64InstrInfo::canFoldIntoAddrMode(const MachineInstr &MemI, if (Extend != AArch64_AM::UXTW && Extend != AArch64_AM::SXTW) return false; - return canFoldAddRegIntoAddrMode(1 << AArch64_AM::getArithShiftValue(Imm), - (Extend == AArch64_AM::SXTW) - ? ExtAddrMode::Formula::SExtScaledReg - : ExtAddrMode::Formula::ZExtScaledReg); + return canFoldAddRegIntoAddrMode( + 1ULL << AArch64_AM::getArithShiftValue(Imm), + (Extend == AArch64_AM::SXTW) ? ExtAddrMode::Formula::SExtScaledReg + : ExtAddrMode::Formula::ZExtScaledReg); } }