[llvm] [AMDGPU][ASAN] Handle special GVs lowering in amdgpu-sw-lower-lds (PR #161827)
Gang Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 11:51:40 PDT 2025
cmc-rep wrote:
> > It seems to me better if we can ignore those "special" GVs in amdgpu-sw-lower-lds, instead of duplicating the call
> > maybe amdgpu-lower-module-lds also needs some adjustment to handle this scenario we have not tested before.
>
> As per the `amdgpu-lower-module-lds` pass, lowering of LDS globals are categorized as two cases as below: LINK:
>
> https://github.com/llvm/llvm-project/blob/0f3ca19483b1f1069144530badfbd66adc5c56b6/llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp#L270
>
>
> // Verify that we fall into one of 2 cases:
> // - All variables are either absolute
> // or direct mapped dynamic LDS that is not lowered.
> // this is a re-run of the pass
> // so we don't have anything to do.
> // - No variables are absolute.
> AFAIU, this check is essential to make the pass idempotent, so that no lowering happens in the rerun once its been done already. And also fails in case of partial lowering. And this is the reason in case of ASAN, we handle all the lowering in the `amdgpu-sw-lower-lds` pass itself.
In amdgpu-lower-module-lds pass, could we modify the check to allow another situation to work:
- All "special" GVs are not assigned but all other normal LDS GV are assigned
https://github.com/llvm/llvm-project/pull/161827
More information about the llvm-commits
mailing list