efriedma added a comment. So gcc has two different behaviors on ARM:
- On linux, prefers `__sync` calls, and generates inline code for load/store. - On baremetal, gcc chooses what sort of atomic call to generate based on how the source code is written: if the user writes `__sync`, you get `__sync`, and if the user writes `__atomic`, the user gets `__atomic`. But it generates inline code for load/store, so it's assuming the __atomic implementation is lock-free. We'd have to hack clang IR generation to generate different IR for the two constructs. I'm not sure what the underlying logic is, or if it's worth trying to emulate. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137980/new/ https://reviews.llvm.org/D137980 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits