[Mlir-commits] [flang] [mlir] [Flang][MLIR] Add `!$omp unroll` and `omp.unroll_heuristic` (PR #144785)

Sergio Afonso llvmlistbot at llvm.org
Thu Jun 19 04:28:49 PDT 2025


skatrak wrote:

Thank you Michael, nice to see this moving forward!

Could you split this PR, to make it more accessible to review? Maybe one PR for generic MLIR infrastructure additions, one for OpenMP MLIR tablegen definitions / headers, one for MLIR to LLVM IR translation and another for Flang lowering changes, for example?

One thing I'm thinking is that we'd probably want to put canonical loop support in Flang under an "experimental" compiler option, to toggle between the existing `omp.loop_nest` based approach and the new `omp.canonical_loop` approach. This first set of changes doesn't seem to actually need it, since it implements a loop transformation that is currently not supported otherwise. But eventually, we're going to be in a place where the canonical loop-based implementation is not complete but is able to support some of the cases the existing approach does, and we probably wouldn't want to make it the default until it reaches parity.

So, I think it'd be nice to pass a flag to be used in Flang lowering to select either `omp.loop_nest` or `omp.canonical_loop` support and be able to progressively work on and test the new approach without breaking things. When we're ready to make the switch, we can just delete the `omp.loop_nest` approach together with the compiler option.

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


More information about the Mlir-commits mailing list