[llvm] [AMDGPU][ASAN] Remove amdgpu-no-flat-scratch-init attribute from lowered kernels in amdgpu-sw-lower-lds pass (PR #160541)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 29 22:55:13 PDT 2025
skc7 wrote:
> The correct fix of this is in the runtime library build. There are 4 plausible fixes:
>
> 1. The runtime function unnecessarily uses optnone, which prevents optimizing out this cast. We should fix this regardless. However, using that as a "fix" isn't great since it's still relying on optimizations, just in the device library build. We could add custom validation to the library build to make sure it satisfies feature expectations.
> 2. The runtime library should be managing its casts more closely by changing the language options to ensure these casts cannot be formed, this is the higher effort version of fixing the library build
> 3. Stop inferring amdgpu-no-flat-scratch-init in sanitized functions. We do similar already for hostcall, this would be an extension of that logic in AMDGPUAttributor
> 4. Undo the AMDGPUAttributor optimization later, which is what this does. This regresses on depending on whole program visibility, so if we're going to hack around this in the compiler I'd rather do option 3
Thanks @arsenm for feedback. Raised PR #161319 for option 3.
https://github.com/llvm/llvm-project/pull/160541
More information about the llvm-commits
mailing list