[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
Tue Jan 21 09:03:53 PST 2025
skc7 wrote:
> > 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.
>
> Loads and stores aren't "supposed" to be" in any particular address space. The pass needs to function independently of context. The description and justification should not be based around -O0 or whatever infer address space happens to do.
>
> It's not clear to me from the description what the symptoms of not handling this cast before are. Was it a fatal error?
With out this patch, catching addressing errors on LDS at -O0 would be missed.
addrspacecasts are on LDS to flat directly. This needs to be fixed.
With changes in this PR, addrspacecasts from LDS to FLAT are detected and they are properly lowered (from LDS to global and then replaced with addrspacecast from global to flat). This would fix catching LDS addressing errors.
https://github.com/llvm/llvm-project/pull/121214
More information about the llvm-commits
mailing list