[PATCH] D153556: [OPENMP52] Initial support for doacross clause.

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 19:58:00 PDT 2023


jyu2 added a comment.

Thanks.



================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:4415-4439
+  } else if (Kind == OMPC_doacross) {
+    // Handle dependence type for the doacross clause.
+    ColonProtectionRAIIObject ColonRAII(*this);
+    Data.ExtraModifier = getOpenMPSimpleClauseType(
+        Kind, Tok.is(tok::identifier) ? PP.getSpelling(Tok) : "",
+        getLangOpts());
+    Data.ExtraModifierLoc = Tok.getLocation();
----------------
ABataev wrote:
> jyu2 wrote:
> > ABataev wrote:
> > > Can it be unified with depenbd clause parsing? (Maybe in a separate template function)
> > I don't really has an idea on how to combine this two with template function.  Since depend clause in ordered is deprecated in 52, and will be removed, should we leave as this?
> Even ff it will be removed in 52, it will still stay for OpenMP < 52. Would be good to try to unify it.
OKay thanks.  Changed


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:20694-20700
+    auto *C = OMPDoacrossClause::Create(
+        Context, StartLoc, LParenLoc, EndLoc,
+        IsSource ? OMPC_DOACROSS_source : OMPC_DOACROSS_sink, DepLoc, ColonLoc,
+        Vars, TotalDepCount.getZExtValue());
+    if (DSAStack->isParentOrderedRegion())
+      DSAStack->addDoacrossDependClause(C, OpsOffs);
+    return C;
----------------
ABataev wrote:
> Better to create clauses in ActOnDoAcross and ActOnDepend, this function better to return required data as a struct/class/bolean, etc.
Okay I create static function instead.  Thanks.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:11299-11344
       if (DC->getDependencyKind() == OMPC_DEPEND_source) {
         if (DependSourceClause) {
           Diag(C->getBeginLoc(), diag::err_omp_more_one_clause)
               << getOpenMPDirectiveName(OMPD_ordered)
               << getOpenMPClauseName(OMPC_depend) << 2;
           ErrorFound = true;
         } else {
----------------
jyu2 wrote:
> ABataev wrote:
> > Try to avoid copy-paste. Maybe introduce templated function?
> Not sure how to do this part.
I just merged code into OMPC_depend.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153556



More information about the cfe-commits mailing list