[llvm] [RFC][LangRef] Specify that the accessed bytes of concurrent atomics must be either disjoint or the same (PR #204329)

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 05:31:50 PDT 2026


================
@@ -3968,13 +3968,20 @@ Given that definition, R\ :sub:`byte` is defined as follows:
    R\ :sub:`byte`, R\ :sub:`byte` returns ``undef`` for that byte.
 -  Otherwise, if R\ :sub:`byte` may see exactly one write,
    R\ :sub:`byte` returns the value written by that write.
--  Otherwise, if R is atomic, and all the writes R\ :sub:`byte` may
-   see are atomic, it chooses one of the values written. See the :ref:`Atomic
+-  Otherwise, if R is atomic, all the writes R\ :sub:`byte` may
+   see are atomic, and R and the writes all access the exact same set of
+   bytes, it chooses one of the values written. See the :ref:`Atomic
----------------
ritter-x2a wrote:

Agreed that being more explicit about how the memory model works is a good thing. Here is a first draft for making that more explicit: #208710

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


More information about the llvm-commits mailing list