diff --git a/flang/include/flang/Lower/OpenMP/Clauses.h b/flang/include/flang/Lower/OpenMP/Clauses.h index 688d01704370d..3eff90b95a20d 100644 --- a/flang/include/flang/Lower/OpenMP/Clauses.h +++ b/flang/include/flang/Lower/OpenMP/Clauses.h @@ -204,6 +204,7 @@ using At = tomp::clause::AtT; using Bind = tomp::clause::BindT; using Capture = tomp::clause::CaptureT; using Collapse = tomp::clause::CollapseT; +using Collector = tomp::clause::CollectorT; using Compare = tomp::clause::CompareT; using Contains = tomp::clause::ContainsT; using Copyin = tomp::clause::CopyinT; @@ -239,6 +240,7 @@ using If = tomp::clause::IfT; using Inbranch = tomp::clause::InbranchT; using Inclusive = tomp::clause::InclusiveT; using Indirect = tomp::clause::IndirectT; +using Inductor = tomp::clause::InductorT; using Init = tomp::clause::InitT; using Initializer = tomp::clause::InitializerT; using InReduction = tomp::clause::InReductionT; diff --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp index 0f60b47991004..2575b7081039b 100644 --- a/flang/lib/Lower/OpenMP/Clauses.cpp +++ b/flang/lib/Lower/OpenMP/Clauses.cpp @@ -249,8 +249,10 @@ MAKE_EMPTY_CLASS(Groupprivate, Groupprivate); MAKE_INCOMPLETE_CLASS(AdjustArgs, AdjustArgs); MAKE_INCOMPLETE_CLASS(AppendArgs, AppendArgs); +MAKE_INCOMPLETE_CLASS(Collector, Collector); MAKE_INCOMPLETE_CLASS(GraphId, GraphId); MAKE_INCOMPLETE_CLASS(GraphReset, GraphReset); +MAKE_INCOMPLETE_CLASS(Inductor, Inductor); MAKE_INCOMPLETE_CLASS(Replayable, Replayable); MAKE_INCOMPLETE_CLASS(Transparent, Transparent); diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp index d7db15dd37949..91308281f2cb6 100644 --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -5466,6 +5466,7 @@ CHECK_SIMPLE_CLAUSE(Affinity, OMPC_affinity) CHECK_SIMPLE_CLAUSE(AppendArgs, OMPC_append_args) CHECK_SIMPLE_CLAUSE(Bind, OMPC_bind) CHECK_SIMPLE_CLAUSE(Capture, OMPC_capture) +CHECK_SIMPLE_CLAUSE(Collector, OMPC_collector) CHECK_SIMPLE_CLAUSE(Compare, OMPC_compare) CHECK_SIMPLE_CLAUSE(Contains, OMPC_contains) CHECK_SIMPLE_CLAUSE(Default, OMPC_default) @@ -5487,6 +5488,7 @@ CHECK_SIMPLE_CLAUSE(Holds, OMPC_holds) CHECK_SIMPLE_CLAUSE(Inbranch, OMPC_inbranch) CHECK_SIMPLE_CLAUSE(Inclusive, OMPC_inclusive) CHECK_SIMPLE_CLAUSE(Indirect, OMPC_indirect) +CHECK_SIMPLE_CLAUSE(Inductor, OMPC_inductor) CHECK_SIMPLE_CLAUSE(Initializer, OMPC_initializer) CHECK_SIMPLE_CLAUSE(Init, OMPC_init) CHECK_SIMPLE_CLAUSE(Link, OMPC_link) diff --git a/llvm/include/llvm/Frontend/OpenMP/ClauseT.h b/llvm/include/llvm/Frontend/OpenMP/ClauseT.h index d7f0e3a3d49da..a86dca06f8ecd 100644 --- a/llvm/include/llvm/Frontend/OpenMP/ClauseT.h +++ b/llvm/include/llvm/Frontend/OpenMP/ClauseT.h @@ -446,7 +446,12 @@ struct CollapseT { N v; }; -// V5.2: [15.8.3] `extended-atomic` clauses +// [6.0:266] +template // +struct CollectorT { + using IncompleteTrait = std::true_type; +}; + template // struct CompareT { using EmptyTrait = std::true_type; @@ -736,6 +741,12 @@ struct IndirectT { OPT(InvokedByFptr) v; }; +// [6.0:265-266] +template // +struct InductorT { + using IncompleteTrait = std::true_type; +}; + // V5.2: [14.1.2] `init` clause template // struct InitT { @@ -1324,8 +1335,9 @@ using EmptyClausesT = std::variant< template using IncompleteClausesT = - std::variant, AppendArgsT, GraphIdT, - GraphResetT, MatchT, OtherwiseT, + std::variant, AppendArgsT, + CollectorT, GraphIdT, GraphResetT, + InductorT, MatchT, OtherwiseT, ReplayableT, TransparentT, WhenT>; template diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td index 208609f64f418..bebab9ba63488 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMP.td +++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td @@ -123,6 +123,8 @@ def OMPC_Collapse : Clause<[Spelling<"collapse">]> { let clangClass = "OMPCollapseClause"; let flangClass = "ScalarIntConstantExpr"; } +def OMPC_Collector : Clause<[Spelling<"collector">]> { +} def OMPC_Compare : Clause<[Spelling<"compare">]> { let clangClass = "OMPCompareClause"; } @@ -264,6 +266,8 @@ def OMPC_Inclusive : Clause<[Spelling<"inclusive">]> { def OMPC_Indirect : Clause<[Spelling<"indirect">]> { let flangClass = "OmpIndirectClause"; } +def OMPC_Inductor : Clause<[Spelling<"inductor">]> { +} def OMPC_Init : Clause<[Spelling<"init">]> { let clangClass = "OMPInitClause"; let flangClass = "OmpInitClause"; @@ -749,6 +753,14 @@ def OMP_Critical : Directive<[Spelling<"critical">]> { let association = AS_Block; let category = CA_Executable; } +def OMP_DeclareInduction : Directive<[Spelling<"declare_induction">]> { + let allowedOnceClauses = [ + VersionedClause, + VersionedClause, + ]; + let association = AS_None; + let category = CA_Declarative; +} def OMP_DeclareMapper : Directive<[Spelling<"declare mapper", 1, 52>, Spelling<"declare_mapper", 60>]> { let requiredClauses = [