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

Marco Elver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 23 07:03:04 PDT 2021


melver 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:
> 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).


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