[PATCH] D98733: [fix][Flang][OpenMP] Allow ordered construct within a non-worksharing loop

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 13:17:41 PDT 2021


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:346
   if (blkDirective.v == llvm::omp::OMPD_ordered) {
-    if (!FindClauseParent(llvm::omp::Clause::OMPC_ordered)) {
+    if (llvm::omp::doSet.test(GetContextParent().directive) &&
+        !FindClauseParent(llvm::omp::Clause::OMPC_ordered)) {
----------------
"An ordered region corresponding to an ordered construct without any clause or with the threads or depend clause may not be closely nested inside a critical, ordered, loop, atomic, task, or taskloop region."

According to the standard the restriction is as given above. Does doSet capture this?



================
Comment at: flang/test/Semantics/omp-ordered-simd.f90:14
+    IF (I <= 10) THEN
+      !$OMP ORDERED SIMD
+      CALL WORK(I)
----------------
"The only OpenMP constructs that can be encountered during execution of a simd (or worksharing-loop SIMD) region are the atomic construct, the loop construct, the simd construct and the ordered construct with the simd clause."

Will you tighten the check in a later patch to ensure that it is an ORDERED SIMD and not ORDERED only construct?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98733



More information about the llvm-commits mailing list