AMDGPU/GlobalISel: Fix selection of constant 32-bit addrspace loads
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 12 Jan 2022 21:28:49 +0000 (16:28 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 17 Jan 2022 15:06:33 +0000 (10:06 -0500)
commit9392b40d4b1999c9b33490829552d928a2fa9bab
tree681e531a7a2733175109755c51a22a2a7f0ad3f3
parent0b1140e883527101599e09462d8aa353cdec1903
AMDGPU/GlobalISel: Fix selection of constant 32-bit addrspace loads

Unfortunately the selection patterns still rely on the address space
from the memory operand instead of using the pointer type. Add this
address space to the list of cases supported by global-like loads.

Alternatively we would have to adjust the address space of the memory
operand to deviate from the underlying IR value, which looks ugly and
is more work in the legalizer.

This doesn't come up in the DAG path because it uses a different
selection strategy where the cast is inserted during the addressing
mode matching.
llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
llvm/test/CodeGen/AMDGPU/GlobalISel/load-constant32bit.ll [new file with mode: 0644]