[PATCH] D106335: [flang][OpenMP] Add semantic check for teams nesting

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 00:35:00 PDT 2021


peixin added a comment.

@kiranchandramohan  Thanks for the review. Fixed the patch according to your comments.



================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:632
+        GetContextParent().directive != llvm::omp::Directive::OMPD_target &&
+        GetContextParent().directive != llvm::omp::Directive::OMPD_teams) {
+      context_.Say(parser::FindSourceLocation(x),
----------------
kiranchandramohan wrote:
> Is the parent teams check required?
The restriction for two strictly nested `teams` has already been checked with the error info of `distribute` and `parallel` region only allowed strictly nested inside `teams` region. Rethink about it and reporting one more error here is more reasonable. Deleted the check of parent `teams` and added the error info in test case `omp-nested-teams.f90`.


================
Comment at: flang/lib/Semantics/check-omp-structure.h:255
+  int directiveNest_[2] = {0};
+  enum directiveNestType { SIMDNest, TargetBlockOnlyTeams };
 };
----------------
kiranchandramohan wrote:
> Nit: Can we add a LastType at the end of the enum and use it as the size of the directiveNest_ array?
Good idea. Added it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106335



More information about the llvm-commits mailing list