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

Guy David via All-commits all-commits at lists.llvm.org
Wed Mar 12 02:11:10 PDT 2025


  Branch: refs/heads/users/guy-david/asan-memory-effects
  Home:   https://github.com/llvm/llvm-project
  Commit: 18531c2e34c39f4a3ed5da8ae3bc8c07205eefc8
      https://github.com/llvm/llvm-project/commit/18531c2e34c39f4a3ed5da8ae3bc8c07205eefc8
  Author: Guy David <guyda96 at gmail.com>
  Date:   2025-03-12 (Wed, 12 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