Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flang/include/flang/Lower/OpenMP/Clauses.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ using At = tomp::clause::AtT<TypeTy, IdTy, ExprTy>;
using Bind = tomp::clause::BindT<TypeTy, IdTy, ExprTy>;
using Capture = tomp::clause::CaptureT<TypeTy, IdTy, ExprTy>;
using Collapse = tomp::clause::CollapseT<TypeTy, IdTy, ExprTy>;
using Collector = tomp::clause::CollectorT<TypeTy, IdTy, ExprTy>;
using Compare = tomp::clause::CompareT<TypeTy, IdTy, ExprTy>;
using Contains = tomp::clause::ContainsT<TypeTy, IdTy, ExprTy>;
using Copyin = tomp::clause::CopyinT<TypeTy, IdTy, ExprTy>;
Expand Down Expand Up @@ -239,6 +240,7 @@ using If = tomp::clause::IfT<TypeTy, IdTy, ExprTy>;
using Inbranch = tomp::clause::InbranchT<TypeTy, IdTy, ExprTy>;
using Inclusive = tomp::clause::InclusiveT<TypeTy, IdTy, ExprTy>;
using Indirect = tomp::clause::IndirectT<TypeTy, IdTy, ExprTy>;
using Inductor = tomp::clause::InductorT<TypeTy, IdTy, ExprTy>;
using Init = tomp::clause::InitT<TypeTy, IdTy, ExprTy>;
using Initializer = tomp::clause::InitializerT<TypeTy, IdTy, ExprTy>;
using InReduction = tomp::clause::InReductionT<TypeTy, IdTy, ExprTy>;
Expand Down
2 changes: 2 additions & 0 deletions flang/lib/Lower/OpenMP/Clauses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions flang/lib/Semantics/check-omp-structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
18 changes: 15 additions & 3 deletions llvm/include/llvm/Frontend/OpenMP/ClauseT.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,12 @@ struct CollapseT {
N v;
};

// V5.2: [15.8.3] `extended-atomic` clauses
// [6.0:266]
template <typename T, typename I, typename E> //
struct CollectorT {
using IncompleteTrait = std::true_type;
};

template <typename T, typename I, typename E> //
struct CompareT {
using EmptyTrait = std::true_type;
Expand Down Expand Up @@ -736,6 +741,12 @@ struct IndirectT {
OPT(InvokedByFptr) v;
};

// [6.0:265-266]
template <typename T, typename I, typename E> //
struct InductorT {
using IncompleteTrait = std::true_type;
};

// V5.2: [14.1.2] `init` clause
template <typename T, typename I, typename E> //
struct InitT {
Expand Down Expand Up @@ -1324,8 +1335,9 @@ using EmptyClausesT = std::variant<

template <typename T, typename I, typename E>
using IncompleteClausesT =
std::variant<AdjustArgsT<T, I, E>, AppendArgsT<T, I, E>, GraphIdT<T, I, E>,
GraphResetT<T, I, E>, MatchT<T, I, E>, OtherwiseT<T, I, E>,
std::variant<AdjustArgsT<T, I, E>, AppendArgsT<T, I, E>,
CollectorT<T, I, E>, GraphIdT<T, I, E>, GraphResetT<T, I, E>,
InductorT<T, I, E>, MatchT<T, I, E>, OtherwiseT<T, I, E>,
ReplayableT<T, I, E>, TransparentT<T, I, E>, WhenT<T, I, E>>;

template <typename T, typename I, typename E>
Expand Down
12 changes: 12 additions & 0 deletions llvm/include/llvm/Frontend/OpenMP/OMP.td
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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<OMPC_Collector, 60>,
VersionedClause<OMPC_Inductor, 60>,
];
let association = AS_None;
let category = CA_Declarative;
}
def OMP_DeclareMapper : Directive<[Spelling<"declare mapper", 1, 52>,
Spelling<"declare_mapper", 60>]> {
let requiredClauses = [
Expand Down
Loading