The patch represents current effort to introduce new "sync_acq", "sync_rel", "sync_seq_cst" atomic orderings in LLVM. They used in sync builtins to generate additional barriers.
It also includes new outline atomics used for these orderings.
The work is in progress. I decided to share it with community early on to get feedback and opinions if it is the right way to implement it. At this moment it is implemented for AArch64 ( aarch64-sync-builtins.ll tests) and I give it a try for RISCV ( but it is not working yet, sync-builtins.ll tests show wrong codegen ). It can affect all targets.
It would be good to know if there are need on other targets to make __sync builtins stonger ( https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html ) like gcc does. I would appriciate any comments and knowledge sharing on this topic. Thank you in advance!
Motivation and requests for this work:
https://reviews.llvm.org/D91157
https://github.com/llvm/llvm-project/issues/29472
These comments are not particularly insightful