[PATCH] D129802: [DRAFT] Implementing new atomic orderings in LLVM and generate barriers for legacy __sync builtins. Support corresponding memory model in outline atomics as well.

Wilco Dijkstra via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 15 06:46:53 PDT 2022


Wilco1 added a comment.

The general requirement is that inline and outline atomics have identical behaviour, and that GCC and LLVM emit the same sequences. I agree __sync is badly documented, so it's hard to figure whether an extra DMB barrier could actually make a difference, but it's best to be conservative with atomics. Also it was trivial to add (GCC just adds an extra flag for __sync which then emits the extra barrier if the flag is set, so you don't need to introduce new atomic models).

However if __sync primitives are hardly used in the real world then perhaps it is about time to deprecate them with annoying warnings, and completely remove support next year. Does that sound reasonable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129802/new/

https://reviews.llvm.org/D129802



More information about the cfe-commits mailing list