[PATCH] D108555: [tsan] Make sanitize-thread-disable.c an X86-only test

Alexander Potapenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 23 07:12:52 PDT 2021


glider added inline comments.


================
Comment at: clang/test/CodeGen/X86/sanitize-thread-disable.c:22
 int instrumented1(int *a, _Atomic int *b) {
   return *a + atomic_load(b);
 }
----------------
melver wrote:
> melver wrote:
> > I think you do not need to use atomic_load.
> > 
> > You can just deref b, and because it's _Atomic type it *should* just use an atomic seq_cst load implicitly.
> Alternatively, there are the `__atomic` builtins. You could just use `__atomic_load_n()` instead (it works with either _Atomic or non-_Atomic type).
You are right, turns out I didn't need the header at all. Removed it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108555/new/

https://reviews.llvm.org/D108555



More information about the cfe-commits mailing list