[llvm-branch-commits] [flang] [llvm] [Flang][OpenMP] Prevent re-composition of composite constructs (PR #102613)

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 9 06:18:03 PDT 2024


================
@@ -2141,13 +2154,50 @@ static void genCompositeTaskloopSimd(
     semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval,
     mlir::Location loc, const ConstructQueue &queue,
     ConstructQueue::const_iterator item, DataSharingProcessor &dsp) {
+  assert(std::distance(item, queue.end()) == 2 && "Invalid leaf constructs");
   TODO(loc, "Composite TASKLOOP SIMD");
 }
 
 //===----------------------------------------------------------------------===//
 // Dispatch
 //===----------------------------------------------------------------------===//
 
+static bool genOMPCompositeDispatch(
+    lower::AbstractConverter &converter, lower::SymMap &symTable,
+    semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval,
+    mlir::Location loc, const ConstructQueue &queue,
+    ConstructQueue::const_iterator item, DataSharingProcessor &dsp) {
+  using llvm::omp::Directive;
+  using llvm::omp::getLeafConstructs, lower::omp::matchLeafSequence;
+
+  if (matchLeafSequence(
+          item, queue,
+          getLeafConstructs(Directive::OMPD_distribute_parallel_do)))
----------------
kparzysz wrote:

Maybe `matchLeafSequence` could take the directive, and call `getLeafConstructs` itself.  It would make these calls a bit tidier...

https://github.com/llvm/llvm-project/pull/102613


More information about the llvm-branch-commits mailing list