[all-commits] [llvm/llvm-project] c9e5fa: [AddressSanitizer] Remove memory effects from func...

Guy David via All-commits all-commits at lists.llvm.org
Fri Mar 14 04:08:20 PDT 2025


  Branch: refs/heads/users/guy-david/asan-memory-effects
  Home:   https://github.com/llvm/llvm-project
  Commit: c9e5fa8ae1ee7d568ff8c35ae6d8d04b6000960d
      https://github.com/llvm/llvm-project/commit/c9e5fa8ae1ee7d568ff8c35ae6d8d04b6000960d
  Author: Guy David <guyda96 at gmail.com>
  Date:   2025-03-14 (Fri, 14 Mar 2025)

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/AddressSanitizer/AMDGPU/asan_instrument_mem_intrinsics.ll
    A llvm/test/Instrumentation/AddressSanitizer/remove-memory-effects.ll

  Log Message:
  -----------
  [AddressSanitizer] Remove memory effects from functions

If left as-is, subsequent optimizations might utilize the possible
memory effects and optimize-out the instrumentation. Think of the
following case:
```
  store i8 4, ptr %shadow
  call void @llvm.lifetime.start.p0(i64 4, ptr %local)
  %28 = call void @foo(ptr %local)
  store i8 -8, ptr %shadow
  call void @llvm.lifetime.end.p0(i64 4, ptr %local)
```

where `foo` is an external function with `memory(argmem: write)`. A pass
such as DeadStoreElimination is allowed to remove the initial store,
which might fail sanitizer checks within `foo`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list