[llvm] [LangRef] State that the memory model is an axiomatic one (PR #208710)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 05:29:24 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Fabian Ritter (ritter-x2a)

<details>
<summary>Changes</summary>

Currently, one could read large parts of the memory model without learning for
sure whether it is meant as an operational model that describes how individual
operations change some notion of state or if it is an axiomatic model (like the
C++ memory model) that lists constraints that a candidate execution must
satisfy to be allowed.

While the description of what a read returns sounds somewhat operational,
aspects like the definition of fence instructions, the monotonic modification
order, and the total order of sequentially consistent operations place it in
the realm of axiomatic models.

This is an attempt to make the nature of the model more explicit (and maybe a
place to discuss the nature of the model), as suggested by RalfJung in the
reviews for #<!-- -->204329.

---
Full diff: https://github.com/llvm/llvm-project/pull/208710.diff


1 Files Affected:

- (modified) llvm/docs/LangRef.md (+2) 


``````````diff
diff --git a/llvm/docs/LangRef.md b/llvm/docs/LangRef.md
index aff4297492445..bdaeb0bb35d22 100644
--- a/llvm/docs/LangRef.md
+++ b/llvm/docs/LangRef.md
@@ -4014,6 +4014,8 @@ The LLVM IR does not define any way to start parallel threads of
 execution or to register signal handlers. Nonetheless, there are
 platform-specific ways to create them, and we define LLVM IR's behavior
 in their presence. This model is inspired by the C++ memory model.
+The memory model is defined axiomatically: it provides constraints that valid
+executions of multi-threaded LLVM IR programs must satisfy.
 
 For a more informal introduction to this model, see the {doc}`Atomics`.
 

``````````

</details>


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


More information about the llvm-commits mailing list