From 2bdd139c0d5e6ea084c588350edf917c562e5492 Mon Sep 17 00:00:00 2001 From: Andrew Adams Date: Tue, 24 Nov 2026 09:54:13 -0800 Subject: [PATCH] Remove redundant fence and reload from 64-bit atomic_load_acquire When the atomic wrappers moved to runtime_atomics.h (#7429), the 64-bit atomic_load_acquire picked up the body of the 32-bit __sync variant after its __atomic acquire load: a full fence followed by a second, plain load that overwrites the result. That is a needless full barrier on every acquire load, and the plain reload is a non-atomic read of a shared location. Restore the plain __atomic acquire load. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/runtime/runtime_atomics.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/runtime/runtime_atomics.h b/src/runtime/runtime_atomics.h index 1e9a2367c3e0..68dd16567fe8 100644 --- a/src/runtime/runtime_atomics.h +++ b/src/runtime/runtime_atomics.h @@ -233,8 +233,6 @@ ALWAYS_INLINE void atomic_load_relaxed(T *addr, T *val) { template ALWAYS_INLINE void atomic_load_acquire(T *addr, T *val) { __atomic_load(addr, val, __ATOMIC_ACQUIRE); - __sync_synchronize(); - *val = *addr; } template