[Mlir-commits] [mlir] [Linalg] Add *Pooling* matchers (PR #172351)

Abhishek Varma llvmlistbot at llvm.org
Mon Dec 15 23:30:03 PST 2025


Abhishek-Varma wrote:

> Do we need all these matchers for our work? I'm worried about tech debts. When can we start working on fixing the matchers in other upstream patterns? E.g.,
> 
> https://github.com/llvm/llvm-project/blob/580fdeb6ff55fcd54be16ed8555eaaa6a9aee1c0/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp#L1631-L1650
> 
> https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

Hi @hanhanW - the above upstream patterns include 60% of the Pooling ops this PR aims to add. As we've already added all Conv1D/2D/3D variants, for consistency, with this PR we will have all Convolution ops' variants finally supported.

Since broadly we have 5 pooling ops' format  `nwc`, `ncw`, `nhwc`, `nchw`,and `ndhwc` that differ only on the summarizing operator and `nhwc`'s support is already added via https://github.com/llvm/llvm-project/pull/163724 - this PR essentially adds support for the other 4 formats.

> When can we start working on fixing the matchers in other upstream patterns?

This PR will be the final when it comes to adding the matchers. Therefore the PR right after this will finally make use of these matchers to allow upstream patterns to work with `linalg.generic` forms as well.

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


More information about the Mlir-commits mailing list