================ @@ -2052,8 +2074,69 @@ static void genCompositeDistributeParallelDo( semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, mlir::Location loc, const ConstructQueue &queue, ConstructQueue::const_iterator item) { + lower::StatementContext stmtCtx; + assert(std::distance(item, queue.end()) == 3 && "Invalid leaf constructs"); - TODO(loc, "Composite DISTRIBUTE PARALLEL DO"); + ConstructQueue::const_iterator distributeItem = item; + ConstructQueue::const_iterator parallelItem = std::next(distributeItem); + ConstructQueue::const_iterator doItem = std::next(parallelItem); + + // Create parent omp.parallel first. + mlir::omp::ParallelOperands parallelClauseOps; + llvm::SmallVector<const semantics::Symbol *> parallelReductionSyms; + llvm::SmallVector<mlir::Type> parallelReductionTypes; + genParallelClauses(converter, semaCtx, stmtCtx, parallelItem->clauses, loc, + parallelClauseOps, parallelReductionTypes, + parallelReductionSyms); + + DataSharingProcessor dsp(converter, semaCtx, doItem->clauses, eval, + /*shouldCollectPreDeterminedSymbols=*/true, + /*useDelayedPrivatization=*/true, &symTable); + dsp.processStep1(¶llelClauseOps); + + genParallelOp(converter, symTable, semaCtx, eval, loc, queue, parallelItem, + parallelClauseOps, parallelReductionSyms, + parallelReductionTypes, &dsp, /*isComposite=*/true); + + // Clause processing. + mlir::omp::DistributeOperands distributeClauseOps; + genDistributeClauses(converter, semaCtx, stmtCtx, distributeItem->clauses, + loc, distributeClauseOps); + + mlir::omp::WsloopOperands wsloopClauseOps; + llvm::SmallVector<const semantics::Symbol *> wsloopReductionSyms; + llvm::SmallVector<mlir::Type> wsloopReductionTypes; + genWsloopClauses(converter, semaCtx, stmtCtx, doItem->clauses, loc, + wsloopClauseOps, wsloopReductionTypes, wsloopReductionSyms); + + mlir::omp::LoopNestOperands loopNestClauseOps; + llvm::SmallVector<const semantics::Symbol *> iv; + genLoopNestClauses(converter, semaCtx, eval, doItem->clauses, loc, + loopNestClauseOps, iv); + + // Operation creation. + // TODO: Populate entry block arguments with private variables. ---------------- tblah wrote:
IIUC this is required for delayed privatisation. Should this have an assertion that delayed privatization is not enabled? https://github.com/llvm/llvm-project/pull/106207 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits