[PATCH] D93205: [Flang][OpenMP 4.5] Add semantic check for OpenMP Do Loop Constructs for single directive

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 15:21:03 PST 2020


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:153
+  case llvm::omp::OMPD_single:
+    for (const auto &dirContext : dirContext_) {
+      if (dirContext.directive == llvm::omp::Directive::OMPD_do) {
----------------
yhegde wrote:
> kiranchandramohan wrote:
> > yhegde wrote:
> > > clementval wrote:
> > > > `dirContext_` act as a stack so do you really intent to go from the bottom of the stack to the top? If so no problem. Just asking. 
> > > Yes. Check on nesting is called only if Do directive present in that stack. 
> > Should this call to HasInvalidWorksharingNesting be similar to the one in OpenMPLoopDirective and happen before pushing the context and not iterate over the entire stack of contexts?
> In OpenMPLoopDirective OMPD_Do context is pushed after calling HasInvalidWorksharingNesting. So I could not do this check in a similar way. 
Is there any issue with pushing the context after calling HasInvalidWorksharingNesting here also?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93205



More information about the llvm-commits mailing list