[all-commits] [llvm/llvm-project] 4669e2: [LangRef] Rewrite the elementwise atomic descripti...
Yonah Goldberg via All-commits
all-commits at lists.llvm.org
Fri Jul 24 13:18:57 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4669e217488dc5bcb2b68f30dd57f845ee6baa71
https://github.com/llvm/llvm-project/commit/4669e217488dc5bcb2b68f30dd57f845ee6baa71
Author: Yonah Goldberg <ygoldberg at nvidia.com>
Date: 2026-07-24 (Fri, 24 Jul 2026)
Changed paths:
M llvm/docs/LangRef.md
M llvm/lib/AsmParser/LLParser.cpp
M llvm/lib/IR/Verifier.cpp
M llvm/test/Assembler/atomic.ll
M llvm/test/Assembler/invalid-atomicrmw-elementwise.ll
M llvm/test/Assembler/invalid-load-store-atomic-elementwise.ll
M llvm/test/Bitcode/atomic-load-store-elementwise.ll
M llvm/test/Bitcode/atomicrmw-elementwise.ll
M llvm/test/Bitcode/compatibility.ll
M llvm/unittests/IR/VerifierTest.cpp
Log Message:
-----------
[LangRef] Rewrite the elementwise atomic description and reject seq_cst elementwise atomics (#209931)
This is a follow-up on the discussion here:
https://github.com/llvm/llvm-project/pull/204329
The problem with specifying `seq_cst` on `elementwise `atomics is that
the LangRef states:
> there is a global total order on all sequentially-consistent
operations on all addresses.
But the individual accesses of `elementwise` `seq_cst` atomics are not
consistent, which contradicts this. I think we could refine this in the
future, but start off by saying `seq_cst` is not permitted.
I think my clarification of the LangRef makes the following example
clearer:
```
// thread 0
store non-atomic [x]
store elementwise atomic release [flag0, flag1] , <1, 1> // writes one to each flag
// thread1
load atomic acquire flag0 == 1
load non-atomic [flag1]
```
there is no execution in which loading from `flag1` in the end is NOT a
data race because there is no consistent ordering of the stores of
`flag0` and `flag1` and therefore acquiring `flag0` does not give us any
information on `flag1`.
My understanding is that in the formal spec working group (which I
should probably attend) people were unsure about allowing
`acquire`/`release`/`acq_rel` on `elementwise`.
This refinement makes the specification of these orderings more formalized.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list