[flang][OpenMP] Upstream lowering of OpenMP Flush construct

Note: This patch reflects the work that can be upstreamed from PR's(merged):

- https://github.com/flang-compiler/f18-llvm-project/pull/476

Reviewed By: kiranchandramohan, clementval

Differential Revision: https://reviews.llvm.org/D90048
This commit is contained in:
Sourabh Singh Tomar 2020-10-23 20:29:12 +05:30
parent b1b2c6ab66
commit e7d37742a2

View File

@ -104,7 +104,16 @@ genOMP(Fortran::lower::AbstractConverter &converter,
genOMP(converter, eval, simpleStandaloneConstruct);
},
[&](const Fortran::parser::OpenMPFlushConstruct &flushConstruct) {
TODO();
SmallVector<Value, 4> operandRange;
if (const auto &ompObjectList =
std::get<std::optional<Fortran::parser::OmpObjectList>>(
flushConstruct.t))
genObjectList(*ompObjectList, converter, operandRange);
if (std::get<std::optional<Fortran::parser::OmpFlushMemoryClause>>(
flushConstruct.t))
TODO("Handle OmpFlushMemoryClause");
converter.getFirOpBuilder().create<mlir::omp::FlushOp>(
converter.getCurrentLocation(), operandRange);
},
[&](const Fortran::parser::OpenMPCancelConstruct &cancelConstruct) {
TODO("");