[PATCH] D108512: [flang][OpenMP] Add semantic checks for ordered construct

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 04:23:12 PDT 2021


peixin updated this revision to Diff 368841.
peixin retitled this revision from "[flang][OpenMP] Add semantic check for ordered construct" to "[flang][OpenMP] Add semantic checks for ordered construct".
peixin edited the summary of this revision.
peixin added a comment.

This patch is based on D94087 <https://reviews.llvm.org/D94087>.
@sameeranjoshi I did some changes from your implementation. Please let me know if you think it is not OK.

I assume that the codes for parsing depend clause in `openmp-parsers.cpp` and `parse-tree.h` are not consistent. Is the following fix OK or should we leave it?

  diff --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h
  index 5ce6a110c1e6..060c8b4a3060 100644
  --- a/flang/include/flang/Parser/parse-tree.h
  +++ b/flang/include/flang/Parser/parse-tree.h
  @@ -3439,9 +3439,9 @@ struct OmpDependSinkVec {
     std::tuple<Name, std::optional<OmpDependSinkVecLength>> t;
   };
  
  -// 2.13.9 depend-type -> IN | OUT | INOUT | SOURCE | SINK
  +// 2.13.9 depend-type -> IN | OUT | INOUT
   struct OmpDependenceType {
  -  ENUM_CLASS(Type, In, Out, Inout, Source, Sink)
  +  ENUM_CLASS(Type, In, Out, Inout)
     WRAPPER_CLASS_BOILERPLATE(OmpDependenceType, Type);
   };

Regarding to the last comment, I think the iteration of clause lit is necessary since multiple semantic checks may be needed such as `depend(source) depend(sink: undecvar - 1) depend(source)`.


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

https://reviews.llvm.org/D108512

Files:
  flang/lib/Semantics/check-omp-structure.cpp
  flang/lib/Semantics/check-omp-structure.h
  flang/lib/Semantics/resolve-directives.cpp
  flang/test/Semantics/omp-clause-validity01.f90
  flang/test/Semantics/omp-ordered01.f90
  llvm/include/llvm/Frontend/OpenMP/OMP.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108512.368841.patch
Type: text/x-patch
Size: 11077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210826/915f3280/attachment.bin>


More information about the llvm-commits mailing list