[flang-commits] [flang] [Flang][OpenMP]Make Do concurrent indices private (PR #93785)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Thu May 30 04:12:25 PDT 2024


================
@@ -1721,6 +1721,25 @@ bool OmpAttributeVisitor::Pre(const parser::DoConstruct &x) {
           }
         }
       }
+    } else if (x.IsDoConcurrent()) {
+      const Fortran::parser::LoopControl *loopControl = &*x.GetLoopControl();
+      const Fortran::parser::LoopControl::Concurrent &concurrent =
+          std::get<Fortran::parser::LoopControl::Concurrent>(loopControl->u);
+      const Fortran::parser::ConcurrentHeader &concurrentHeader =
+          std::get<Fortran::parser::ConcurrentHeader>(concurrent.t);
+      const std::list<Fortran::parser::ConcurrentControl> &controls =
+          std::get<std::list<Fortran::parser::ConcurrentControl>>(
+              concurrentHeader.t);
+      for (const auto &control : controls) {
+        const parser::Name *iv{&std::get<0>(control.t)};
+        if (iv && iv->symbol) {
+          if (!iv->symbol->test(Symbol::Flag::OmpPreDetermined)) {
+            ResolveSeqLoopIndexInParallelOrTaskConstruct(*iv);
+          } else {
+            // TODO: conflict checks with explicitly determined DSA
+          }
+        }
+      }
----------------
kiranchandramohan wrote:

Is the threadprivate check not applicable here?

https://github.com/llvm/llvm-project/pull/93785


More information about the flang-commits mailing list