[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:59:04 PST 2026
banach-space wrote:
> This can be solved by adding control functions to decomposition patterns. The upstream patterns provide transformations and downstream users build the passes with the patterns.
+1
> Doesn't vectorization already force users to collect ops and call [vectorize](https://github.com/llvm/llvm-project/blob/dff081c26f11e1679411e7c0b4012e6a740b6cc3/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L2703-L2707) method? I thought that users are already filtering the ops and apply vectorization. E.g., you match the op and vectorize the op. Users still can disallow the op in their vectorization list. Am I missing something here?
Hm, but if you pass `linalg.generic` and specialize inside the vectorizer, then you will end-up here:https://github.com/llvm/llvm-project/blob/dff081c26f11e1679411e7c0b4012e6a740b6cc3/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L2739
rather than here:
https://github.com/llvm/llvm-project/blob/dff081c26f11e1679411e7c0b4012e6a740b6cc3/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L2768
You can still solve this with a control function, yes. Btw, here's a slightly different TD example: https://github.com/llvm/llvm-project/blob/dff081c26f11e1679411e7c0b4012e6a740b6cc3/mlir/test/Dialect/Linalg/vectorization/convolution-with-patterns.mlir#L68
Note that in this case it doesn't really matter what Op is matched.
https://github.com/llvm/llvm-project/pull/174196
More information about the Mlir-commits
mailing list