[llvm] [AMDGPU][CodeGen] Update support (soffset + offset) s_buffer_load's (PR #68302)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 03:54:25 PDT 2023
================
@@ -33,6 +33,11 @@ AMDGPU::getBaseWithConstantOffset(MachineRegisterInfo &MRI, Register Reg,
int64_t Offset;
if (Def->getOpcode() == TargetOpcode::G_ADD) {
+ // A 32-bit (address + offset) should not cause unsigned 32-bit integer
+ // wraparound, because s_load instructions perform the addition in 64 bits.
+ if (!Def->getFlag(MachineInstr::NoUWrap) &&
+ MRI.getType(Reg).getScalarSizeInBits() == 32 && checkNUW)
----------------
kosarev wrote:
The check replaced with an assert LGTM.
https://github.com/llvm/llvm-project/pull/68302
More information about the llvm-commits
mailing list