[flang-commits] [flang] [llvm] [mlir] [flang][OpenMP] Support the FULL clause on the UNROLL construct (PR #214115)

Spencer Bryngelson via flang-commits flang-commits at lists.llvm.org
Wed Aug 12 08:50:16 PDT 2026


sbryngelson wrote:

Added in e7c6eec, and yes it is still wanted -- @tblah's point was that these are separate interface boundaries. The folding change did not remove the requirement, it removed the obstacle: before it, `m_Constant()` rejected flang's own output for `do i = 1, 100`, so the check was unimplementable. Now flang's output passes and the verifier can do its job, which is rejecting a non-constant trip count from any producer of `omp.unroll_full`, not just flang.

`UnrollFullOp::verify` now checks the applyee's trip count, guarded on the generator actually being an `omp.canonical_loop`; a CLI produced by another transformation does not state one, so those are left alone rather than wrongly rejected.

It is not a no-op: it rejected three of this PR's own tests, which were passing dynamic trip counts to `omp.unroll_full`. Those are updated to constants, which is what the op now requires. No pre-existing test in tree was affected.

New `mlir/test/Dialect/OpenMP/invalid-unroll.mlir` covers the rejection, a constant trip count being accepted, and `omp.unroll_partial` still accepting a dynamic one.

`mlir/test/Target/LLVMIR` and `mlir/test/Dialect/OpenMP` are 436/436 locally.


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


More information about the flang-commits mailing list