[flang-commits] [flang] [Flang][MLIR][OpenMP] Add MLIR lowering support for taskloop clauses. (PR #165851)

Jack Styles via flang-commits flang-commits at lists.llvm.org
Fri Nov 7 07:24:18 PST 2025


================
@@ -1770,14 +1770,18 @@ static void genTaskloopClauses(lower::AbstractConverter &converter,
                                mlir::omp::TaskloopOperands &clauseOps) {
 
   ClauseProcessor cp(converter, semaCtx, clauses);
+  cp.processAllocate(clauseOps);
+  cp.processFinal(stmtCtx, clauseOps);
   cp.processGrainsize(stmtCtx, clauseOps);
+  cp.processIf(llvm::omp::Directive::OMPD_taskloop, clauseOps);
+  cp.processMergeable(clauseOps);
   cp.processNumTasks(stmtCtx, clauseOps);
+  cp.processPriority(stmtCtx, clauseOps);
+  cp.processUntied(clauseOps);
 
-  cp.processTODO<clause::Allocate, clause::Collapse, clause::Default,
-                 clause::Final, clause::If, clause::InReduction,
-                 clause::Lastprivate, clause::Mergeable, clause::Nogroup,
-                 clause::Priority, clause::Reduction, clause::Shared,
-                 clause::Untied>(loc, llvm::omp::Directive::OMPD_taskloop);
+  cp.processTODO<clause::Collapse, clause::InReduction, clause::Lastprivate,
----------------
Stylie777 wrote:

No worries! Thanks for your patch, I have since abandoned my duplicate patches for the clauses you posted in favour of yours.

In terms of the TODO tests, we should really have tests present for everything that is still TODO to make sure the user is getting the messages we are expecting them to get when they try to use the clause. While we both have PR's in the pipeline that will fill in some more of the gaps, the tests should still be present here and we can remove them later down the line. I know the exist for Reduction/InReduction, so adding them for Collapse, Lastprivate and Nogroup at this stage I think is acceptable.

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


More information about the flang-commits mailing list