[flang-commits] [flang] [llvm] [Flang][OpenMP]Handling restrictions of using Memory-Order-Clause with Atomic-Clause (PR #199636)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Tue May 26 09:15:34 PDT 2026
================
@@ -1587,6 +1587,59 @@ void OmpStructureChecker::Enter(const parser::OpenMPAtomicConstruct &x) {
checkExclusive(atomic, "atomic", dirSpec.Clauses());
checkExclusive(memoryOrder, "memory-order", dirSpec.Clauses());
+ // Check for incompatible memory orderings on specific atomic operations.
+ // Per OpenMP 5.0+:
+ // - atomic read: release and acq_rel are not allowed
+ // - atomic write: acquire and acq_rel are not allowed
+ // - atomic update (without capture): acquire and acq_rel are not allowed
----------------
kparzysz wrote:
This is only in OpenMP 5.0. Starting from OpenMP 5.1 the restrictions are
- If _atomic-clause_ is **read** then memory-order-clause must not be **release**.
- If _atomic-clause_ is **write** then memory-order-clause must not be **acquire**.
Nothing about **update**.
https://github.com/llvm/llvm-project/pull/199636
More information about the flang-commits
mailing list