[flang] [llvm] [mlir] [flang][OpenMP] Enable tiling (PR #143715)

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 05:57:51 PDT 2025


================
@@ -2036,9 +2077,9 @@ static mlir::omp::LoopNestOp genLoopNestOp(
     return llvm::SmallVector<const semantics::Symbol *>(iv);
   };
 
-  auto *nestedEval =
-      getCollapsedLoopEval(eval, getCollapseValue(item->clauses));
-
+  uint64_t nestValue = getCollapseValue(item->clauses);
+  nestValue = nestValue < iv.size() ? iv.size() : nestValue;
----------------
skatrak wrote:

As far as I can tell, the `iv` list is still populated by `ClauseProcessor::processCollapse`, so the number of loops represented by the `omp.loop_nest` is going to still be tied to the `collapse` clause. If there is a multi-dim `tile` transformation applied to nested loops and no `collapse`, aren't we just going to cause an MLIR verifier failure because there will just be a single IV for an e.g. `tile(2, 4)`?

Changes here seem to indicate that we can actually get more IVs than what the `collapse` property of the loop nest is, but I can't see how that would currently happen. It seems like we'd want that to be possible but currently isn't, or am I missing something?

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


More information about the llvm-commits mailing list