[PATCH] D83326: [flang][openmp] Check clauses allowed semantic with tablegen generated map

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 06:45:34 PDT 2020


clementval added a comment.

Thanks for the review. I just updates the patch and answered your questions.



================
Comment at: flang/test/Semantics/omp-clause-validity01.f90:457
 
-  !ERROR: REDUCTION clause is not allowed on the TASKLOOP SIMD directive
   !$omp taskloop simd reduction(+:a)
----------------
ichoyjx wrote:
> clementval wrote:
> > As a side note, This is supposed to be fine in Clang so I removed the check. I looked at the OpenMP 5.0 std and didn't see a restriction on `reduction` for `task loop simd`.
> What's the current plan? Are we trying to cover OpenMP 5.0 Spec for semantics (it appears so)?
Clang just moved to 5.0as default and my guesses that we are targeting 5.0 as well since it is the current standard. 


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMP.td:229
     VersionedClause<OMPC_Allocate>,
     VersionedClause<OMPC_Detach, 50>,
     VersionedClause<OMPC_Affinity, 50>
----------------
ichoyjx wrote:
> Bear with me, what does 50 mean?
The `VersionedClause` is defined as this: `VersionedClause<VersionedClause<Clause c, int min = 1, int max = 0x7FFFFFFF>`

So here it means the clause is valid from version 5.0 and up. This is currently not used in Flang but in Clang it's used and I took the value from the old macros definition `OMPKinds.def`. So version 4.5 would 45 and so on. 


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMP.td:427
     VersionedClause<OMPC_Map>,
-    VersionedClause<OMPC_NoWait>,
-    VersionedClause<OMPC_Depend>
+    VersionedClause<OMPC_NoWait>
+  ];
----------------
ichoyjx wrote:
> For `target enter` and `target exit`, `nowait` is only allowed once. If it's allowed here, will this restriction be captured by the rules in `target` directive above?
Good catch. I updated the patch and moved them in the correct set. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83326/new/

https://reviews.llvm.org/D83326





More information about the llvm-commits mailing list