[llvm] [docs] Reflect C++'s read-write and write-read coherence rules in the LLVM memory model (PR #217849)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 09:51:02 PDT 2026


================
@@ -4170,10 +4170,27 @@ happens-before must be perfectly overlapping to act atomically.
     read-modify-write operation M ({ref}`cmpxchg <i_cmpxchg>` and
     {ref}`atomicrmw <i_atomicrmw>`) reads from a perfectly overlapping
     `monotonic` (or stronger) write W, W must be immediately before M in
-    the relevant modification order. If one atomic read happens before
-    another perfectly overlapping atomic read and both are at least
-    `monotonic`, the later read must not see an earlier value in the
-    address's modification order. This disallows reordering of perfectly
+    the relevant modification order.
+
+    Atomic accesses that are `monotonic` (or stronger) satisfy coherence
+    rules. Let the reads R, R1, R2 and the writes W, W1, W2 referenced
----------------
gonzalobg wrote:

Fabian I think the text is implicitly stating that `unordered` atomics do not satisfy coherence rules. 
Should that be explicit? 

For example (feel free to ignore this):

```suggestion
    rules; `unordered` atomics do not. Let the reads R, R1, R2 and the writes W, W1, W2 referenced
```

https://github.com/llvm/llvm-project/pull/217849


More information about the llvm-commits mailing list