[llvm] [AMDGPU] Introduce "amdgpu-sw-lower-lds" pass to lower LDS accesses. (PR #87265)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 04:09:48 PDT 2024


skc7 wrote:

> This is much more tied in with the sanitizer than I would like liked. I was hoping for a totally standalone software implementation, that would then be subject to ordinary sanitization. This is directly inserting address sanitizer calls in the same pass. Can you only include the malloc parts, and have the regular sanitizer pass then sanitize the mallocs?

- Asan pass runs early in optimization pipeline. This pass (amdgpu-sw-lower-lds) is placed before "lower-module-lds" pass as in #89206, which runs before codegen. 
- This pass is checking if "sanitize_address" attribute is present on the function and only then lowers lds to global memory for those instructions in function.

Based on the above points, we have made decision to directly include asan calls, and also account for redzones in this pass. 
We could consider splitting this pass, first lowering of LDS to global memory and then instrumenting newly lowered memory operations as future work.

CC: @b-sumner 

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


More information about the llvm-commits mailing list