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

Abhishek Varma llvmlistbot at llvm.org
Tue Jan 6 01:19:37 PST 2026


================
@@ -108,10 +108,12 @@ getReassociationMapForFoldingUnitDims(ArrayRef<OpFoldResult> mixedSizes);
 
 /// Given a linalg `op` this function returns true if it is a convolution op of
 /// type `ConvOpTy` and populates `dilations` and `strides` with values inferred
-/// from the indexing maps.
+/// from the indexing maps. If `dilations` or `strides` is nullptr, the
+/// corresponding values are not populated.
 template <typename ConvOpTy>
-bool isaConvolutionOpOfType(LinalgOp op, SmallVector<int64_t> *dilations,
-                            SmallVector<int64_t> *strides);
+bool isaConvolutionOpOfType(LinalgOp op,
+                            SmallVector<int64_t> *dilations = nullptr,
+                            SmallVector<int64_t> *strides = nullptr);
----------------
Abhishek-Varma wrote:

Hi @hanhanW - you make a fair point and I've addressed this comment.

I've also added another `RUN` line which was a cleaner (one line change) approach instead of duplicating the tests for generic convolution ops (CC: @banach-space ).

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


More information about the Mlir-commits mailing list