[flang-commits] [flang] [llvm] [flang][OpenMP] Decompose compound constructs, do recursive lowering (PR #90098)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Tue May 7 06:46:50 PDT 2024
================
@@ -1447,43 +1397,47 @@ genParallelOp(Fortran::lower::AbstractConverter &converter,
// TODO Merge with the reduction CB.
genInfo.setGenRegionEntryCb(genRegionEntryCB).setDataSharingProcessor(&dsp);
- return genOpWithBody<mlir::omp::ParallelOp>(genInfo, clauseOps);
+ return genOpWithBody<mlir::omp::ParallelOp>(genInfo, queue, item, clauseOps);
}
static mlir::omp::SectionOp
genSectionOp(Fortran::lower::AbstractConverter &converter,
Fortran::lower::SymMap &symTable,
Fortran::semantics::SemanticsContext &semaCtx,
- Fortran::lower::pft::Evaluation &eval, bool genNested,
- mlir::Location loc, const List<Clause> &clauses) {
+ Fortran::lower::pft::Evaluation &eval, mlir::Location loc,
+ const List<Clause> &clauses, const ConstructQueue &queue,
+ ConstructQueue::iterator item) {
// Currently only private/firstprivate clause is handled, and
// all privatization is done within `omp.section` operations.
return genOpWithBody<mlir::omp::SectionOp>(
OpWithBodyGenInfo(converter, symTable, semaCtx, loc, eval,
llvm::omp::Directive::OMPD_section)
- .setGenNested(genNested)
- .setClauses(&clauses));
+ .setClauses(&clauses),
+ queue, item);
}
static mlir::omp::SectionsOp
genSectionsOp(Fortran::lower::AbstractConverter &converter,
Fortran::lower::SymMap &symTable,
Fortran::semantics::SemanticsContext &semaCtx,
Fortran::lower::pft::Evaluation &eval, mlir::Location loc,
- const mlir::omp::SectionsClauseOps &clauseOps) {
+ const List<Clause> &clauses, const ConstructQueue &queue,
+ ConstructQueue::iterator item) {
+ mlir::omp::SectionsClauseOps clauseOps;
+ genSectionsClauses(converter, semaCtx, clauses, loc, clauseOps);
----------------
kparzysz wrote:
For `parallel sections` we process the `parallel` first with the clauses that are associated with it. Unless we need to process the clauses from `sections` in there as well, this should work.
If we need to process extra clauses with `parallel`, it is something we will need to address elsewhere. We should get the same behavior with `parallel sections` in a single construct, and `parallel`, `sections` written separately. The spec does not treat either of these cases differently from the other, so to get the clauses processed in the same way we'd need to have an implementation that doesn't differentiate between these two cases.
https://github.com/llvm/llvm-project/pull/90098
More information about the flang-commits
mailing list