[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
This commit is contained in:
Valentin Clement 2022-03-28 13:36:10 +02:00
parent 07f33a357d
commit 534b228313
No known key found for this signature in database
GPG key ID: 086D54783C928776
2 changed files with 67 additions and 9 deletions

View file

@ -1503,19 +1503,19 @@ private:
//===--------------------------------------------------------------------===//
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 @@ private:
}
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) {

View file

@ -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 &) {