Skip to content

[flang][OpenMP] Minimal fix for flang build after 'omp assume' patch #102008

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
merged 1 commit into from
Aug 5, 2024

Conversation

jtb20
Copy link
Contributor

@jtb20 jtb20 commented Aug 5, 2024

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

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

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir flang:openmp flang:semantics labels Aug 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 5, 2024

@llvm/pr-subscribers-flang-openmp
@llvm/pr-subscribers-flang-semantics

@llvm/pr-subscribers-flang-fir-hlfir

Author: Julian Brown (jtb20)

Changes

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

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


Full diff: https://github.com/llvm/llvm-project/pull/102008.diff

3 Files Affected:

  • (modified) flang/lib/Lower/OpenMP/Clauses.cpp (+29)
  • (modified) flang/lib/Lower/OpenMP/Clauses.h (+6)
  • (modified) flang/lib/Semantics/check-omp-structure.cpp (+6)
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)

Copy link

github-actions bot commented Aug 5, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@vzakhari
Copy link
Contributor

vzakhari commented Aug 5, 2024

Pete, can you please take a look?

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

Thanks to Maxim Kuvyrkov and the Linaro auto-tester for the heads-up.
@psteinfeld
Copy link
Contributor

Pete, can you please take a look?

I'm on it.

Copy link
Contributor

@psteinfeld psteinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the content of the changes, but I know that this fixes the build and that it passes all of the lit tests. Please merge ASAP.

@jtb20
Copy link
Contributor Author

jtb20 commented Aug 5, 2024

Thank you. I don't have write access so could someone please commit this for me?

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix. I'll merge without any nitpicks to get this in ASAP.

@tblah tblah merged commit 6d68860 into llvm:main Aug 5, 2024
7 checks passed
@jtb20 jtb20 deleted the minimal-omp-assume-flang-fix branch August 5, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang:openmp flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants