diff --git a/compiler-rt/lib/builtins/atomic.c b/compiler-rt/lib/builtins/atomic.c --- a/compiler-rt/lib/builtins/atomic.c +++ b/compiler-rt/lib/builtins/atomic.c @@ -120,14 +120,12 @@ return locks + (hash & SPINLOCK_MASK); } -/// Macros for determining whether a size is lock free. Clang can not yet -/// codegen __atomic_is_lock_free(16), so for now we assume 16-byte values are -/// not lock free. -#define IS_LOCK_FREE_1 __c11_atomic_is_lock_free(1) -#define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) -#define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -#define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) -#define IS_LOCK_FREE_16 0 +/// Macros for determining whether a size is lock free. +#define IS_LOCK_FREE_1 __atomic_always_lock_free(1, NULL) +#define IS_LOCK_FREE_2 __atomic_always_lock_free(2, NULL) +#define IS_LOCK_FREE_4 __atomic_always_lock_free(4, NULL) +#define IS_LOCK_FREE_8 __atomic_always_lock_free(8, NULL) +#define IS_LOCK_FREE_16 __atomic_always_lock_free(16, NULL) /// Macro that calls the compiler-generated lock-free versions of functions /// when they exist.