[llvm] [RFC][BPF] Do atomic_fetch_*() pattern matching with memory ordering (PR #107343)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 12:20:58 PDT 2024
eddyz87 wrote:
> > Question: should BPF backend report and error if `__ATOMIC_{CONSUME,ACQUIRE,RELEASE,ACQ_REL}` is used?
>
> Why not use the strongest ordering for all those "intermediate" orderings instead of erroring out? Just use `__ATOMIC_SEQ_CST`? If, in the future, BPF has weaker orderings, then we can always downgrade to that (probably with cpu version bump).
I assume that there would be some reasoning behind users asking for a specific memory order (e.g. hope for better performance), and thus it's better to let user know that which orderings are supported.
But falling back to `__ATOMIC_SEQ_CST` is an option, yes.
https://github.com/llvm/llvm-project/pull/107343
More information about the llvm-commits
mailing list