-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[OpenMP] Add definitions of TASKGRAPH, GRAPH_ID and GRAPH_RESET #157502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This only adds the definitions of the TASKGRAPH directive and the associated clauses, plus the minimal additional changes to make everything compile without errors.
@llvm/pr-subscribers-flang-openmp @llvm/pr-subscribers-flang-fir-hlfir Author: Krzysztof Parzyszek (kparzysz) ChangesThis only adds the definitions of the TASKGRAPH directive and the associated clauses, plus the minimal additional changes to make everything compile without errors. Full diff: https://github.com/llvm/llvm-project/pull/157502.diff 5 Files Affected:
diff --git a/flang/include/flang/Lower/OpenMP/Clauses.h b/flang/include/flang/Lower/OpenMP/Clauses.h
index 1ab594ffcd209..638846835094c 100644
--- a/flang/include/flang/Lower/OpenMP/Clauses.h
+++ b/flang/include/flang/Lower/OpenMP/Clauses.h
@@ -229,6 +229,8 @@ using Firstprivate = tomp::clause::FirstprivateT<TypeTy, IdTy, ExprTy>;
using From = tomp::clause::FromT<TypeTy, IdTy, ExprTy>;
using Full = tomp::clause::FullT<TypeTy, IdTy, ExprTy>;
using Grainsize = tomp::clause::GrainsizeT<TypeTy, IdTy, ExprTy>;
+using GraphId = tomp::clause::GraphIdT<TypeTy, IdTy, ExprTy>;
+using GraphReset = tomp::clause::GraphResetT<TypeTy, IdTy, ExprTy>;
using HasDeviceAddr = tomp::clause::HasDeviceAddrT<TypeTy, IdTy, ExprTy>;
using Hint = tomp::clause::HintT<TypeTy, IdTy, ExprTy>;
using Holds = tomp::clause::HoldsT<TypeTy, IdTy, ExprTy>;
diff --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp
index 1a16e1c87e250..cecc1a9395892 100644
--- a/flang/lib/Lower/OpenMP/Clauses.cpp
+++ b/flang/lib/Lower/OpenMP/Clauses.cpp
@@ -221,6 +221,8 @@ MAKE_EMPTY_CLASS(Capture, Capture);
MAKE_EMPTY_CLASS(Compare, Compare);
MAKE_EMPTY_CLASS(DynamicAllocators, DynamicAllocators);
MAKE_EMPTY_CLASS(Full, Full);
+MAKE_EMPTY_CLASS(GraphId, GraphId);
+MAKE_EMPTY_CLASS(GraphReset, GraphReset);
MAKE_EMPTY_CLASS(Inbranch, Inbranch);
MAKE_EMPTY_CLASS(Mergeable, Mergeable);
MAKE_EMPTY_CLASS(Nogroup, Nogroup);
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 85d79a00d9aff..d1654a3adcc9c 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -2793,6 +2793,8 @@ CHECK_SIMPLE_CLAUSE(Final, OMPC_final)
CHECK_SIMPLE_CLAUSE(Flush, OMPC_flush)
CHECK_SIMPLE_CLAUSE(Full, OMPC_full)
CHECK_SIMPLE_CLAUSE(Grainsize, OMPC_grainsize)
+CHECK_SIMPLE_CLAUSE(GraphId, OMPC_graph_id)
+CHECK_SIMPLE_CLAUSE(GraphReset, OMPC_graph_reset)
CHECK_SIMPLE_CLAUSE(Holds, OMPC_holds)
CHECK_SIMPLE_CLAUSE(Inclusive, OMPC_inclusive)
CHECK_SIMPLE_CLAUSE(Initializer, OMPC_initializer)
diff --git a/llvm/include/llvm/Frontend/OpenMP/ClauseT.h b/llvm/include/llvm/Frontend/OpenMP/ClauseT.h
index 8ea50e7e8d416..56905854f9baa 100644
--- a/llvm/include/llvm/Frontend/OpenMP/ClauseT.h
+++ b/llvm/include/llvm/Frontend/OpenMP/ClauseT.h
@@ -660,6 +660,18 @@ struct GrainsizeT {
std::tuple<OPT(Prescriptiveness), GrainSize> t;
};
+// [6.0:438] `graph_id` clause
+template <typename T, typename I, typename E> //
+struct GraphIdT {
+ using EmptyTrait = std::true_type;
+};
+
+// [6.0:438] `graph_reset` clause
+template <typename T, typename I, typename E> //
+struct GraphResetT {
+ using EmptyTrait = std::true_type;
+};
+
// V5.2: [5.4.9] `has_device_addr` clause
template <typename T, typename I, typename E> //
struct HasDeviceAddrT {
@@ -1254,10 +1266,11 @@ using ExtensionClausesT =
template <typename T, typename I, typename E>
using EmptyClausesT = std::variant<
AcqRelT<T, I, E>, AcquireT<T, I, E>, CaptureT<T, I, E>, CompareT<T, I, E>,
- DynamicAllocatorsT<T, I, E>, FullT<T, I, E>, InbranchT<T, I, E>,
- MergeableT<T, I, E>, NogroupT<T, I, E>, NoOpenmpRoutinesT<T, I, E>,
- NoOpenmpT<T, I, E>, NoParallelismT<T, I, E>, NotinbranchT<T, I, E>,
- NowaitT<T, I, E>, ReadT<T, I, E>, RelaxedT<T, I, E>, ReleaseT<T, I, E>,
+ DynamicAllocatorsT<T, I, E>, FullT<T, I, E>, GraphIdT<T, I, E>,
+ GraphResetT<T, I, E>, InbranchT<T, I, E>, MergeableT<T, I, E>,
+ NogroupT<T, I, E>, NoOpenmpRoutinesT<T, I, E>, NoOpenmpT<T, I, E>,
+ NoParallelismT<T, I, E>, NotinbranchT<T, I, E>, NowaitT<T, I, E>,
+ ReadT<T, I, E>, RelaxedT<T, I, E>, ReleaseT<T, I, E>,
ReverseOffloadT<T, I, E>, SeqCstT<T, I, E>, SimdT<T, I, E>,
ThreadsT<T, I, E>, UnifiedAddressT<T, I, E>, UnifiedSharedMemoryT<T, I, E>,
UnknownT<T, I, E>, UntiedT<T, I, E>, UseT<T, I, E>, WeakT<T, I, E>,
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td
index 036b932acff9e..d65b36a4f4d4f 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -226,6 +226,10 @@ def OMPC_GrainSize : Clause<[Spelling<"grainsize">]> {
OMP_GRAINSIZE_Unknown
];
}
+def OMPC_GraphId : Clause<[Spelling<"graph_id">]> {
+}
+def OMPC_GraphReset : Clause<[Spelling<"graph_reset">]> {
+}
def OMPC_HasDeviceAddr : Clause<[Spelling<"has_device_addr">]> {
let clangClass = "OMPHasDeviceAddrClause";
let flangClass = "OmpObjectList";
@@ -1210,6 +1214,16 @@ def OMP_Task : Directive<[Spelling<"task">]> {
let association = AS_Block;
let category = CA_Executable;
}
+def OMP_Taskgraph : Directive<[Spelling<"taskgraph">]> {
+ let allowedOnceClauses = [
+ VersionedClause<OMPC_GraphId, 60>,
+ VersionedClause<OMPC_GraphReset, 60>,
+ VersionedClause<OMPC_If>,
+ VersionedClause<OMPC_NoGroup>,
+ ];
+ let association = AS_Block;
+ let category = CA_Executable;
+}
def OMP_TaskGroup : Directive<[Spelling<"taskgroup">]> {
let allowedClauses = [
VersionedClause<OMPC_Allocate, 50>,
|
LGTM, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:openmp
OpenMP related changes to Clang
flang:fir-hlfir
flang:openmp
flang:semantics
flang
Flang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This only adds the definitions of the TASKGRAPH directive and the associated clauses, plus the minimal additional changes to make everything compile without errors.