[flang-commits] [flang] e7d3774 - [flang][OpenMP] Upstream lowering of OpenMP `Flush` construct
Sourabh Singh Tomar via flang-commits
flang-commits at lists.llvm.org
Fri Oct 23 08:39:59 PDT 2020
Author: Sourabh Singh Tomar
Date: 2020-10-23T21:09:50+05:30
New Revision: e7d37742a2a584fef9002778b33f9453647ab43c
URL: https://github.com/llvm/llvm-project/commit/e7d37742a2a584fef9002778b33f9453647ab43c
DIFF: https://github.com/llvm/llvm-project/commit/e7d37742a2a584fef9002778b33f9453647ab43c.diff
LOG: [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
Added:
Modified:
flang/lib/Lower/OpenMP.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 9c9c0a298dd6..5b69800176ea 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -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("");
More information about the flang-commits
mailing list