[llvm] [AMDGPU] Handle lowering addrspace casts from LDS to FLAT address in amdgpu-sw-lower-lds. (PR #121214)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 21:13:48 PST 2025


skc7 wrote:

> This doesn't feel like a sound approach. What happens if the pointer value is captured in any way?

Since, infer-address-space pass is not run prior to this pass at -O0, load/stores that were supposed to be on lds ptrs are now on flat ptrs with extra addrspacecasts from lds to flat ptr being added.

This PR tries to specifically handle these casts from LDS to FLAT. It does it first by lowering lds ptr to corresponding ptr in global memory and then replaces the original cast with addrspacecast from global ptr to flat ptr.

https://github.com/llvm/llvm-project/pull/121214


More information about the llvm-commits mailing list