[llvm] [flang][OpenMP] Mark atomic clauses as unique (PR #137460)
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 26 06:42:35 PDT 2025
https://github.com/kparzysz created https://github.com/llvm/llvm-project/pull/137460
The current implementation of the ATOMIC construct handles these clauses individually, and this change does not have an observable effect. At the same time these clauses are unique as per the OpenMP spec, and this patch reflects that in the OMP.td file.
>From 4aa88f8d04afcba35a1486e2661e5a29170694bf Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Sat, 26 Apr 2025 07:58:29 -0500
Subject: [PATCH] [flang][OpenMP] Mark atomic clauses as unique
The current implementation of the ATOMIC construct handles these clauses
individually, and this change does not have an observable effect. At the
same time these clauses are unique as per the OpenMP spec, and this patch
reflects that in the OMP.td file.
---
llvm/include/llvm/Frontend/OpenMP/OMP.td | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td
index eff6d57995d2b..cdfd3e3223fa8 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -602,22 +602,20 @@ def OMP_Assume : Directive<"assume"> {
];
}
def OMP_Atomic : Directive<"atomic"> {
- let allowedClauses = [
- VersionedClause<OMPC_Capture>,
- VersionedClause<OMPC_Compare, 51>,
- VersionedClause<OMPC_Read>,
- VersionedClause<OMPC_Update>,
- VersionedClause<OMPC_Write>,
- ];
let allowedOnceClauses = [
VersionedClause<OMPC_AcqRel, 50>,
VersionedClause<OMPC_Acquire, 50>,
+ VersionedClause<OMPC_Capture>,
+ VersionedClause<OMPC_Compare, 51>,
VersionedClause<OMPC_Fail, 51>,
VersionedClause<OMPC_Hint, 50>,
+ VersionedClause<OMPC_Read>,
VersionedClause<OMPC_Relaxed, 50>,
VersionedClause<OMPC_Release, 50>,
VersionedClause<OMPC_SeqCst>,
+ VersionedClause<OMPC_Update>,
VersionedClause<OMPC_Weak, 51>,
+ VersionedClause<OMPC_Write>,
];
let association = AS_Block;
let category = CA_Executable;
@@ -668,7 +666,7 @@ def OMP_CancellationPoint : Directive<"cancellation point"> {
let category = CA_Executable;
}
def OMP_Critical : Directive<"critical"> {
- let allowedClauses = [
+ let allowedOnceClauses = [
VersionedClause<OMPC_Hint>,
];
let association = AS_Block;
More information about the llvm-commits
mailing list