[PATCH] D141567: [Flang] [OpenMP] Refine parser restrictions for OMP TARGET UPDATE clauses.
Raghu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 22:44:37 PST 2023
raghavendhra created this revision.
Herald added subscribers: guansong, yaxunl.
Herald added projects: Flang, All.
raghavendhra requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1, jdoerfert.
Herald added a project: LLVM.
In Parser, move some clauses of OMP TARGET UPDATE to allowedOnceClauses so that restrictions will be imposed.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141567
Files:
flang/test/Semantics/OpenMP/omp-device-constructs.f90
llvm/include/llvm/Frontend/OpenMP/OMP.td
Index: llvm/include/llvm/Frontend/OpenMP/OMP.td
===================================================================
--- llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -788,13 +788,15 @@
}
def OMP_TargetUpdate : Directive<"target update"> {
let allowedClauses = [
- VersionedClause<OMPC_If>,
- VersionedClause<OMPC_Device>,
VersionedClause<OMPC_To>,
VersionedClause<OMPC_From>,
- VersionedClause<OMPC_NoWait>,
VersionedClause<OMPC_Depend>
];
+ let allowedOnceClauses = [
+ VersionedClause<OMPC_Device>,
+ VersionedClause<OMPC_If>,
+ VersionedClause<OMPC_NoWait>
+ ];
}
def OMP_ParallelFor : Directive<"parallel for"> {
let allowedClauses = [
Index: flang/test/Semantics/OpenMP/omp-device-constructs.f90
===================================================================
--- flang/test/Semantics/OpenMP/omp-device-constructs.f90
+++ flang/test/Semantics/OpenMP/omp-device-constructs.f90
@@ -162,6 +162,14 @@
!ERROR: Only the FROM, RELEASE, DELETE map types are permitted for MAP clauses on the TARGET EXIT DATA directive
!$omp target exit data map(to:a)
+ !$omp target update if(.true.) device(1) to(a) from(b) depend(inout:c) nowait
+
+ !ERROR: At most one IF clause can appear on the TARGET UPDATE directive
+ !$omp target update to(a) if(.true.) if(.false.)
+
+ !ERROR: At most one DEVICE clause can appear on the TARGET UPDATE directive
+ !$omp target update device(0) device(1) from(b)
+
!$omp target
!ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
!$omp distribute
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141567.488484.patch
Type: text/x-patch
Size: 1611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230112/735b658f/attachment.bin>
More information about the llvm-commits
mailing list