[Mlir-commits] [mlir] feat(linalg): add a way to pass controlFn to `foldIntoPackUnpackPatterns` (PR #143685)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jun 24 07:13:50 PDT 2025


Max191 wrote:

> but before I send you down that rabbit hole, @Max191 or @hanhanW what do you guys think?

In general I don't see an issue with adding optional control functions to patterns, since it does give more control over the pattern application, although exposing the transforms as functions does give even more control (and you can always turn these transform functions into patterns anyway). That said, in this case, I do think the rewrite makes sense as a pattern application. These patterns can open up new folding opportunities, so the recursive pattern application is helpful here. Also, the patterns can be run alongside things like data layout propagation patterns, which can further expose more folding opportunities.

TLDR; I think this is going to end up being better as a pattern rewrite after all anyway, so I don't see any issue with just adding a control function to the patterns.

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


More information about the Mlir-commits mailing list