AMDGPU/GlobalISel: Fix negative offset folding for buffer_load
authorPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 27 Apr 2021 12:44:59 +0000 (14:44 +0200)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 27 Apr 2021 12:45:22 +0000 (14:45 +0200)
commit8110fcc8fc56cb5d2fc0cbab882ddfdae2536201
treea0c7c2ae5b306a4b470d0085f62957434ae34d26
parent6a3e1b3531c08db59e2864b3c46a2e4303505f8e
AMDGPU/GlobalISel: Fix negative offset folding for buffer_load

Buffer_load does unsigned offset calculations. Don't fold
operands of 32-bit add that are likely to cause unsigned add
overflow (common case is when one of the operands is negative).

Differential Revision: https://reviews.llvm.org/D91336
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.mir