[Mlir-commits] [mlir] [Linalg] Update Conv Decomposition patterns to work with generic convolution ops as well (PR #174196)

Andrzej Warzyński llvmlistbot at llvm.org
Tue Jan 6 06:15:30 PST 2026


banach-space wrote:

> A transformation should be able to do the same thing for named ops and generic form ops; it's user's choice for the input format.

Sure, but I think this is exactly where the concern lies. Today, users can intentionally prevent convolution-specific behaviour by choosing `linalg.generic` instead of `linalg.conv`. By folding **Specialization** into **Decomposition**, we effectively remove that option, without enabling functionality that isn’t already available (since decomposing `linalg.generic` can already be achieved via (2) from my original post).

A related issue is vectorization behaviour. Currently, a `linalg.generic` encoding a convolution will not vectorize (`precondition failed: not projected permutations`). If vectorization includes specialization, the same op would suddenly become vectorizable, which changes observable behaviour. This also raises a longer-term concern: if support is later added to vectorize such `linalg.generic` ops directly, we would end up with two independent vectorization paths for convolution-like ops, with no clear mechanism to select between them.

>From my perspective, **Specialization** is conceptually a pre-processing step that should be applied before transformations like **Decomposition** or **Vectorization**, rather than being embedded inside them. This doesn't affect my usage and I won't be blocking this change. However, I would be great to hear from e.g. @rengolin who recently contributed [Interchangeability of Forms](https://mlir.llvm.org/docs/Rationale/RationaleLinalgDialect/#interchangeability-of-formsa-nameformsa) to our docs.

If we do go ahead with this, the summary should be extended with rationale (there's good level of "what", but not enough of "why") and the updated transformations sign-posted (e.g. with comments that both `linalg.conv` and `linalg.generic` are matched).

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


More information about the Mlir-commits mailing list