[llvm-dev] Memory model: clarifying the semantics of unordered atomic loads & stores

Nicolai Hähnle-Montoro via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 13 08:13:44 PDT 2019

Hi all,

There is a seeming contradiction, or possibly just an oversight, in
some of the language defining atomics and fences in relation to the
unordered ordering in LangRef.rst and Atomics.rst. This has come up in
discussions related to the memory model in Vulkan.

Atomics.rst says about unorderd: "This cannot be used for synchronization"

However, the semantics of fence instructions in LangRef.rst talks
about fences A, B and related atomic operations X, Y establishing a
happens-before relation between A and B.

We suspect that the intention here is that X and Y both must have at
least a _monotonic_ ordering. Is that correct?

Lerne, wie die Welt wirklich ist,
aber vergiss niemals, wie sie sein sollte.

More information about the llvm-dev mailing list