[PATCH] D90048: [flang][OpenMP] Upstream lowering of OpenMP `Flush` construct

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 08:21:36 PDT 2020


SouraVX updated this revision to Diff 300303.
SouraVX added a comment.

Removed ununsed variable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90048/new/

https://reviews.llvm.org/D90048

Files:
  flang/lib/Lower/OpenMP.cpp


Index: flang/lib/Lower/OpenMP.cpp
===================================================================
--- flang/lib/Lower/OpenMP.cpp
+++ flang/lib/Lower/OpenMP.cpp
@@ -104,7 +104,16 @@
             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("");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90048.300303.patch
Type: text/x-patch
Size: 1073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201023/96ae0be5/attachment.bin>


More information about the llvm-commits mailing list