AMDGPU: Ensure flat loads are broken into dword in functions
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 26 Jan 2023 00:46:44 +0000 (20:46 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Sun, 5 Feb 2023 09:25:15 +0000 (05:25 -0400)
commit6ce86a7effea8e516a0f242aa06ad73e4557150d
tree9c98d44a794b7879adc8211e5be6792b1d98bdb8
parent6747fc07d1aa94e22622e278e5a02ba70675ac9b
AMDGPU: Ensure flat loads are broken into dword in functions

We were assuming we could rely on the flat scratch init detection
to imply if there are possible flat addressed stack objects, which
doesn't work outside of a kernel. We should have a way to prove
if a given flat access can't access the stack.

We could use a not-stack parameter attribute to avoid
these splits.

Make the minimally correct change for GlobalISel; I'll address
this better in my larger patch to rewrite load and store legalization.

Fixes: SWDEV-218237
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-flat.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.atomic.dec.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.atomic.inc.ll
llvm/test/CodeGen/AMDGPU/flat-address-space.ll