amdgcn: Fix masked loads from LDS for masked access
Corrects masked load instructions for Local Data Share (LDS) memory on AMD GCN targets.
The masked load support for ds_read/ds_write instructions in the AMD GCN backend incorrectly handled pointer sizes when accessing Local Data Share (LDS) memory. This issue, while not previously causing problems due to infrequent masked vector access to LDS, has been fixed by introducing a new instruction specifically for LDS address spaces. This ensures correct behavior for masked loads from LDS.
In Details
The AMD GCN backend's gen_load<mode>_exec instructions were not correctly handling the pointer size for LDS accesses when masked loads were involved. This commit separates the LDS alternatives into a new instruction, gen_load<mode>_exec_ds, to properly manage the address space and pointer size mismatch that previously occurred. The existing load<mode>_exec instruction now excludes the LDS alternative. A new test case, simt-lds-load-1.c, has been added to verify this fix.
- LDS
- Local Data Share, a small, fast on-chip memory accessible by all threads within a workgroup on AMD GPUs.
- masked load
- A memory load operation where only specific elements of a vector are loaded, based on a mask. This is often used in SIMD/SIMT operations.
- AMDGCN
- AMD's Graphics Core Next architecture, used in their GPUs. GCC targets this architecture for GPGPU computation.
- SIMT
- Single Instruction, Multiple Threads. A parallel execution model where multiple threads execute the same instruction concurrently, often used in GPUs. It's a variation of SIMD (Single Instruction, Multiple Data).