[llvm] [clang] [ASan][Driver] Add sanitize-target flag to support enabling ASan in device or host compilation (PR #76127)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 23:31:28 PST 2023


jinge90 wrote:

Hi, @vitalybuka and @bader 
Recently, we are working to enable address sanitizer for SYCL and OMP offloading compiler. After enabling Asan instrumentation pass, ASanPass will insert "__asan_*" functions into user code in both device and host compilation. Although host code sanitizer is useful, sometimes we care more about device code sanitizer in offloading scenario and a flag to disable/enable ASan in host or device compilation phase will help. If offloading compiler's user wants to use sanitizer to detect bugs in their device code target for GPU, FPGA or other accelerators, they can add '-fsanitize-target=device' to disable ASanPass in host code(CPU code).
Thanks very much.

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


More information about the cfe-commits mailing list