[flang-commits] [flang] [flang][OpenMP] Minimal fix for flang build after 'omp assume' patch (PR #102008)

Julian Brown via flang-commits flang-commits at lists.llvm.org
Mon Aug 5 09:15:25 PDT 2024


https://github.com/jtb20 created https://github.com/llvm/llvm-project/pull/102008

This patch restores the flang build, which was inadvertently broken by the patch to implement 'omp assume' support
(a42e515e3a9f3bb4e44389c097b89104d95b9b29).

Thanks to Maxim Kuvyrkov and the Linaro auto-tester for the heads-up.

>From d9ea1c555c3509595bd2d6748e29fae5d971f31f Mon Sep 17 00:00:00 2001
From: Julian Brown <julian.brown at amd.com>
Date: Mon, 5 Aug 2024 11:09:33 -0500
Subject: [PATCH] [flang][OpenMP] Minimal fix for flang build after 'omp
 assume' patch

This patch restores the flang build, which was inadvertently broken by
the patch to implement 'omp assume' support
(a42e515e3a9f3bb4e44389c097b89104d95b9b29).

Thanks to Maxim Kuvyrkov and the Linaro auto-tester for the heads-up.
---
 flang/lib/Lower/OpenMP/Clauses.cpp          | 29 +++++++++++++++++++++
 flang/lib/Lower/OpenMP/Clauses.h            |  6 +++++
 flang/lib/Semantics/check-omp-structure.cpp |  6 +++++
 3 files changed, 41 insertions(+)

diff --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp
index c355b63deff8a..5b77c8c97b7c4 100644
--- a/flang/lib/Lower/OpenMP/Clauses.cpp
+++ b/flang/lib/Lower/OpenMP/Clauses.cpp
@@ -322,6 +322,11 @@ ReductionOperator makeReductionOperator(const parser::OmpReductionOperator &inp,
 // Actual clauses. Each T (where tomp::T exists in ClauseT) has its "make".
 
 // Absent: missing-in-parser
+Absent make(const parser::OmpClause::Absent &inp,
+            semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: absent");
+}
+
 // AcqRel: empty
 // Acquire: empty
 // AdjustArgs: incomplete
@@ -444,7 +449,12 @@ Collapse make(const parser::OmpClause::Collapse &inp,
 }
 
 // Compare: empty
+
 // Contains: missing-in-parser
+Contains make(const parser::OmpClause::Contains &inp,
+              semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: contains");
+}
 
 Copyin make(const parser::OmpClause::Copyin &inp,
             semantics::SemanticsContext &semaCtx) {
@@ -705,6 +715,10 @@ Hint make(const parser::OmpClause::Hint &inp,
 }
 
 // Holds: missing-in-parser
+Holds make(const parser::OmpClause::Holds &inp,
+           semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: holds");
+}
 
 If make(const parser::OmpClause::If &inp,
         semantics::SemanticsContext &semaCtx) {
@@ -884,8 +898,23 @@ Nontemporal make(const parser::OmpClause::Nontemporal &inp,
 }
 
 // NoOpenmp: missing-in-parser
+NoOpenmp make(const parser::OmpClause::NoOpenmp &inp,
+              semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: no_openmp");
+}
+
 // NoOpenmpRoutines: missing-in-parser
+NoOpenmpRoutines make(const parser::OmpClause::NoOpenmpRoutines &inp,
+              semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: no_openmp_routines");
+}
+
 // NoParallelism: missing-in-parser
+NoParallelism make(const parser::OmpClause::NoParallelism &inp,
+                   semantics::SemanticsContext &semaCtx) {
+  llvm_unreachable("Unimplemented: no_parallelism");
+}
+
 // Notinbranch: empty
 
 Novariants make(const parser::OmpClause::Novariants &inp,
diff --git a/flang/lib/Lower/OpenMP/Clauses.h b/flang/lib/Lower/OpenMP/Clauses.h
index 98fb5dcf7722e..c7874935d8605 100644
--- a/flang/lib/Lower/OpenMP/Clauses.h
+++ b/flang/lib/Lower/OpenMP/Clauses.h
@@ -159,6 +159,7 @@ using ReductionOperator = tomp::type::ReductionIdentifierT<IdTy, ExprTy>;
 // These clauses are still handled here to cover all alternatives in the
 // main clause variant.
 
+using Absent = tomp::clause::AbsentT<TypeTy, IdTy, ExprTy>;
 using AcqRel = tomp::clause::AcqRelT<TypeTy, IdTy, ExprTy>;
 using Acquire = tomp::clause::AcquireT<TypeTy, IdTy, ExprTy>;
 using AdjustArgs = tomp::clause::AdjustArgsT<TypeTy, IdTy, ExprTy>;
@@ -174,6 +175,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 Contains = tomp::clause::ContainsT<TypeTy, IdTy, ExprTy>;
 using Compare = tomp::clause::CompareT<TypeTy, IdTy, ExprTy>;
 using Copyin = tomp::clause::CopyinT<TypeTy, IdTy, ExprTy>;
 using Copyprivate = tomp::clause::CopyprivateT<TypeTy, IdTy, ExprTy>;
@@ -199,6 +201,7 @@ using Full = tomp::clause::FullT<TypeTy, IdTy, ExprTy>;
 using Grainsize = tomp::clause::GrainsizeT<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>;
 using If = tomp::clause::IfT<TypeTy, IdTy, ExprTy>;
 using Inbranch = tomp::clause::InbranchT<TypeTy, IdTy, ExprTy>;
 using Inclusive = tomp::clause::InclusiveT<TypeTy, IdTy, ExprTy>;
@@ -213,6 +216,9 @@ using Map = tomp::clause::MapT<TypeTy, IdTy, ExprTy>;
 using Match = tomp::clause::MatchT<TypeTy, IdTy, ExprTy>;
 using Mergeable = tomp::clause::MergeableT<TypeTy, IdTy, ExprTy>;
 using Message = tomp::clause::MessageT<TypeTy, IdTy, ExprTy>;
+using NoOpenmp = tomp::clause::NoOpenmpT<TypeTy, IdTy, ExprTy>;
+using NoOpenmpRoutines = tomp::clause::NoOpenmpRoutinesT<TypeTy, IdTy, ExprTy>;
+using NoParallelism = tomp::clause::NoParallelismT<TypeTy, IdTy, ExprTy>;
 using Nocontext = tomp::clause::NocontextT<TypeTy, IdTy, ExprTy>;
 using Nogroup = tomp::clause::NogroupT<TypeTy, IdTy, ExprTy>;
 using Nontemporal = tomp::clause::NontemporalT<TypeTy, IdTy, ExprTy>;
diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index e150495d189c4..50840898438c7 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -2220,10 +2220,12 @@ void OmpStructureChecker::Enter(const parser::OmpClause &x) {
 }
 
 // Following clauses do not have a separate node in parse-tree.h.
+CHECK_SIMPLE_CLAUSE(Absent, OMPC_absent)
 CHECK_SIMPLE_CLAUSE(AcqRel, OMPC_acq_rel)
 CHECK_SIMPLE_CLAUSE(Acquire, OMPC_acquire)
 CHECK_SIMPLE_CLAUSE(Affinity, OMPC_affinity)
 CHECK_SIMPLE_CLAUSE(Capture, OMPC_capture)
+CHECK_SIMPLE_CLAUSE(Contains, OMPC_contains)
 CHECK_SIMPLE_CLAUSE(Default, OMPC_default)
 CHECK_SIMPLE_CLAUSE(Depobj, OMPC_depobj)
 CHECK_SIMPLE_CLAUSE(Destroy, OMPC_destroy)
@@ -2236,6 +2238,7 @@ CHECK_SIMPLE_CLAUSE(Flush, OMPC_flush)
 CHECK_SIMPLE_CLAUSE(From, OMPC_from)
 CHECK_SIMPLE_CLAUSE(Full, OMPC_full)
 CHECK_SIMPLE_CLAUSE(Hint, OMPC_hint)
+CHECK_SIMPLE_CLAUSE(Holds, OMPC_holds)
 CHECK_SIMPLE_CLAUSE(InReduction, OMPC_in_reduction)
 CHECK_SIMPLE_CLAUSE(Inclusive, OMPC_inclusive)
 CHECK_SIMPLE_CLAUSE(Match, OMPC_match)
@@ -2248,6 +2251,9 @@ CHECK_SIMPLE_CLAUSE(Inbranch, OMPC_inbranch)
 CHECK_SIMPLE_CLAUSE(Link, OMPC_link)
 CHECK_SIMPLE_CLAUSE(Indirect, OMPC_indirect)
 CHECK_SIMPLE_CLAUSE(Mergeable, OMPC_mergeable)
+CHECK_SIMPLE_CLAUSE(NoOpenmp, OMPC_no_openmp)
+CHECK_SIMPLE_CLAUSE(NoOpenmpRoutines, OMPC_no_openmp_routines)
+CHECK_SIMPLE_CLAUSE(NoParallelism, OMPC_no_parallelism)
 CHECK_SIMPLE_CLAUSE(Nogroup, OMPC_nogroup)
 CHECK_SIMPLE_CLAUSE(Notinbranch, OMPC_notinbranch)
 CHECK_SIMPLE_CLAUSE(Partial, OMPC_partial)



More information about the flang-commits mailing list