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

Guy David via All-commits all-commits at lists.llvm.org
Mon Mar 10 08:37:21 PDT 2025


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

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
    M llvm/lib/Passes/PassBuilder.cpp
    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