Atomic ordering for LLVM's memory model.
Declared in <llvm/Support/AtomicOrdering.h>
enum class AtomicOrdering : unsigned int;
C++ defines ordering as a lattice. LLVM supplements this with NotAtomic and Unordered, which are both below the C++ orders.
not_atomic-->unordered-->relaxed-->release--------------->acq_rel-->seq_cst -->consume-->acquire--/
| Name | Description |
|---|---|
NotAtomic | Non-atomic access; the default for ordinary LLVM loads and stores. |
Unordered | Weakest atomicity: well-defined under races, but no synchronization. |
Monotonic | Atomic with a consistent per-address order; equivalent to C++ relaxed. |
Acquire | Synchronize with prior releases of the same atomic location (load/RMW). |
Release | Make prior stores visible to subsequent acquires of the same location. |
AcquireRelease | Read-modify-write operations that both acquire and release, combining the effects of Acquire and Release on the same atomic access. |
SequentiallyConsistent | Read-modify-write operations that both acquire and release, combining the effects of Acquire and Release on the same atomic access. |
LAST | Read-modify-write operations that both acquire and release, combining the effects of Acquire and Release on the same atomic access. |
| Name | Description |
|---|---|
getMergedAtomicOrdering | Return a single atomic ordering that is at least as strong as both the AO and Other orderings for an atomic operation. |
isAcquireOrStronger | Return true if AO is Acquire or stronger in the atomic ordering lattice. |
isAtLeastOrStrongerThan | Return true if AO is at least as strong as Other in the atomic ordering lattice. |
isReleaseOrStronger | Return true if AO is Release or stronger in the atomic ordering lattice. |
isStrongerThan | Returns true if ao is stronger than other as defined by the AtomicOrdering lattice, which is based on C++'s definition. |
isStrongerThanMonotonic | Return true if AO is strictly stronger than Monotonic. |
isStrongerThanUnordered | Return true if AO is strictly stronger than Unordered. |
operator< | Deleted; LLVM atomic orders form a lattice, not a total order. |
operator<= | Deleted; LLVM atomic orders form a lattice, not a total order. |
operator> | Deleted; LLVM atomic orders form a lattice, not a total order. |
operator>= | Deleted; LLVM atomic orders form a lattice, not a total order. |
toCABI | Map LLVM AO to the corresponding C11/C++11 ABI memory-order encoding. |
toIRString | String used by LLVM IR to represent atomic ordering. |