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

Arnamoy B via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 12:55:43 PDT 2021


arnamoy10 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)) {
----------------
kiranchandramohan wrote:
> "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?
> 
Thanks, updating the patch.


================
Comment at: flang/test/Semantics/omp-ordered-simd.f90:14
+    IF (I <= 10) THEN
+      !$OMP ORDERED SIMD
+      CALL WORK(I)
----------------
kiranchandramohan wrote:
> "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?
Yes, one more patch to take care of that!


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