[flang-commits] [flang] 534b228 - [flang] Lower some coarray statements to their runtime functions
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Mon Mar 28 04:36:38 PDT 2022
Author: Valentin Clement
Date: 2022-03-28T13:36:32+02:00
New Revision: 534b228313409a781060856d6cb6c2e9523cba5b
URL: https://github.com/llvm/llvm-project/commit/534b228313409a781060856d6cb6c2e9523cba5b
DIFF: https://github.com/llvm/llvm-project/commit/534b228313409a781060856d6cb6c2e9523cba5b.diff
LOG: [flang] Lower some coarray statements to their runtime functions
This patch adds the lowering of coarray statements to the runtime
functions. The runtime functions are currently not implemented.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D122466
Added:
Modified:
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/Runtime.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index e9da31f18f1b5..8184030772591 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -1503,19 +1503,19 @@ class FirConverter : public Fortran::lower::AbstractConverter {
//===--------------------------------------------------------------------===//
void genFIR(const Fortran::parser::EventPostStmt &stmt) {
- TODO(toLocation(), "EventPostStmt lowering");
+ genEventPostStatement(*this, stmt);
}
void genFIR(const Fortran::parser::EventWaitStmt &stmt) {
- TODO(toLocation(), "EventWaitStmt lowering");
+ genEventWaitStatement(*this, stmt);
}
void genFIR(const Fortran::parser::FormTeamStmt &stmt) {
- TODO(toLocation(), "FormTeamStmt lowering");
+ genFormTeamStatement(*this, getEval(), stmt);
}
void genFIR(const Fortran::parser::LockStmt &stmt) {
- TODO(toLocation(), "LockStmt lowering");
+ genLockStatement(*this, stmt);
}
fir::ExtendedValue
@@ -1883,23 +1883,23 @@ class FirConverter : public Fortran::lower::AbstractConverter {
}
void genFIR(const Fortran::parser::SyncAllStmt &stmt) {
- TODO(toLocation(), "SyncAllStmt lowering");
+ genSyncAllStatement(*this, stmt);
}
void genFIR(const Fortran::parser::SyncImagesStmt &stmt) {
- TODO(toLocation(), "SyncImagesStmt lowering");
+ genSyncImagesStatement(*this, stmt);
}
void genFIR(const Fortran::parser::SyncMemoryStmt &stmt) {
- TODO(toLocation(), "SyncMemoryStmt lowering");
+ genSyncMemoryStatement(*this, stmt);
}
void genFIR(const Fortran::parser::SyncTeamStmt &stmt) {
- TODO(toLocation(), "SyncTeamStmt lowering");
+ genSyncTeamStatement(*this, stmt);
}
void genFIR(const Fortran::parser::UnlockStmt &stmt) {
- TODO(toLocation(), "UnlockStmt lowering");
+ genUnlockStatement(*this, stmt);
}
void genFIR(const Fortran::parser::AssignStmt &stmt) {
diff --git a/flang/lib/Lower/Runtime.cpp b/flang/lib/Lower/Runtime.cpp
index 8e65ab5749a4f..65fb2eeb6ae60 100644
--- a/flang/lib/Lower/Runtime.cpp
+++ b/flang/lib/Lower/Runtime.cpp
@@ -107,6 +107,64 @@ void Fortran::lower::genStopStatement(
genUnreachable(builder, loc);
}
+void Fortran::lower::genFailImageStatement(
+ Fortran::lower::AbstractConverter &converter) {
+ fir::FirOpBuilder &builder = converter.getFirOpBuilder();
+ mlir::Location loc = converter.getCurrentLocation();
+ mlir::FuncOp callee =
+ fir::runtime::getRuntimeFunc<mkRTKey(FailImageStatement)>(loc, builder);
+ builder.create<fir::CallOp>(loc, callee, llvm::None);
+ genUnreachable(builder, loc);
+}
+
+void Fortran::lower::genEventPostStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::EventPostStmt &) {
+ TODO(converter.getCurrentLocation(), "EVENT POST runtime");
+}
+
+void Fortran::lower::genEventWaitStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::EventWaitStmt &) {
+ TODO(converter.getCurrentLocation(), "EVENT WAIT runtime");
+}
+
+void Fortran::lower::genLockStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::LockStmt &) {
+ TODO(converter.getCurrentLocation(), "LOCK runtime");
+}
+
+void Fortran::lower::genUnlockStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::UnlockStmt &) {
+ TODO(converter.getCurrentLocation(), "UNLOCK runtime");
+}
+
+void Fortran::lower::genSyncAllStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::SyncAllStmt &) {
+ TODO(converter.getCurrentLocation(), "SYNC ALL runtime");
+}
+
+void Fortran::lower::genSyncImagesStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::SyncImagesStmt &) {
+ TODO(converter.getCurrentLocation(), "SYNC IMAGES runtime");
+}
+
+void Fortran::lower::genSyncMemoryStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::SyncMemoryStmt &) {
+ TODO(converter.getCurrentLocation(), "SYNC MEMORY runtime");
+}
+
+void Fortran::lower::genSyncTeamStatement(
+ Fortran::lower::AbstractConverter &converter,
+ const Fortran::parser::SyncTeamStmt &) {
+ TODO(converter.getCurrentLocation(), "SYNC TEAM runtime");
+}
+
void Fortran::lower::genPauseStatement(
Fortran::lower::AbstractConverter &converter,
const Fortran::parser::PauseStmt &) {
More information about the flang-commits
mailing list