[llvm] [BPF] treat compiler fence as codegen no-op (PR #196734)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 07:49:33 PDT 2026


yonghong-song wrote:

Beyond the above rust example. The below are two C examples:
```
  void memory_barrier(void) {
      __sync_synchronize();                                                                                        
  }
```
or
```
#include <stdatomic.h>
void memory_barrier(void) {
  __c11_atomic_thread_fence(__ATOMIC_ACQUIRE);
}
```
where __sync_synchronize() will generate IR 'fence seq_cst',
and __c11_atomic_thread_fence(__ATOMIC_ACQUIRE) will generate IR 'fence acquire'.

https://github.com/llvm/llvm-project/pull/196734


More information about the llvm-commits mailing list