[llvm] [LangRef] Specify that syncscopes can affect the monotonic modification order (PR #189017)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 00:07:51 PDT 2026


================
@@ -4024,18 +4024,22 @@ For a simpler introduction to the ordering constraints, see the
 .. _syncscope:
 
 If an atomic operation is marked ``syncscope("singlethread")``, it only
-*synchronizes with* and only participates in the seq\_cst total orderings of
-other operations running in the same thread (for example, in signal handlers).
+*synchronizes with* other operations running in the same thread (for
+example, in signal handlers) and the constraints on its position
+relative to other operations in the seq\_cst order and the monotonic
+modification order only apply to operations in the same thread.
 
 If an atomic operation is marked ``syncscope("<target-scope>")``, where
-``<target-scope>`` is a target-specific synchronization scope, then it is target
-dependent if it *synchronizes with* and participates in the seq\_cst total
-orderings of other operations.
-
-Otherwise, an atomic operation that is not marked ``syncscope("singlethread")``
-or ``syncscope("<target-scope>")`` *synchronizes with* and participates in the
-seq\_cst total orderings of other operations that are not marked
-``syncscope("singlethread")`` or ``syncscope("<target-scope>")``.
+``<target-scope>`` is a target-specific synchronization scope, then it
+is target-dependent if it *synchronizes with* other operations and
+relative to which operations the constraints on its position in the
+seq\_cst order and the monotonic modification order apply.
+
+Otherwise, an atomic operation that is not marked
+``syncscope("singlethread")`` or ``syncscope("<target-scope>")`` at
+least *synchronizes with* and is ordered in the seq\_cst order and the
+monotonic modification order relative to other operations that are not
+marked ``syncscope("singlethread")`` or ``syncscope("<target-scope>")``.
----------------
ssahasra wrote:

```suggestion
``syncscope("singlethread")`` or ``syncscope("<target-scope>")`` 
*synchronizes with* and is related in the seq\_cst order and the
monotonic modification order with other operations that are not
marked ``syncscope("singlethread")`` or ``syncscope("<target-scope>")``.
```

The use of "at least" is jarring ... the general style is additive (or sufficient): "if constraint satisfied then related" which implicitly allows other constraints to create more relations. Then if a constraint is necessary, that sentence will strategically put an "only" or "only if" somewhere.

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


More information about the llvm-commits mailing list