[Mlir-commits] [mlir] [NFC][Linalg] Introduce ConvMatchBuilder + refactor Conv matchers (PR #169704)

Andrzej WarzyƄski llvmlistbot at llvm.org
Sun Nov 30 09:15:22 PST 2025


================
@@ -434,6 +430,91 @@ static bool convLayoutMatches(ArrayRef<ArrayRef<AffineExpr>> mapListExpected,
                           })));
 }
 
+/// Enum of all kinds of Pooling Op's type.
+enum PoolingType {
+  NONE,
+  MAX_SIGNED,
+  MAX_UNSIGNED,
+  MIN_SIGNED,
+  MIN_UNSIGNED,
+  SUM
+};
+
+/// Helper class for building convolution op matchers with minimal boilerplate.
+/// Reduces repetitive code across Conv1D/2D/3D and Depthwise variants as well
+/// as Pooling ops.
+class ConvMatcherBuilder {
+  LinalgOp op;
+  MLIRContext *ctx;
+  SmallVector<int64_t> *dilations, *strides;
+  ArrayAttr indexingMaps;
+  PoolingType poolingType;
+  bool matched = true;
----------------
banach-space wrote:

Why is it initialised to `true`?

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


More information about the Mlir-commits mailing list