[Mlir-commits] [mlir] [MLIR][Linalg] Simplify tiling canonical pattern (PR #182909)
Renato Golin
llvmlistbot at llvm.org
Tue Feb 24 07:18:11 PST 2026
================
@@ -80,6 +80,16 @@ def ApplyFoldUnitExtentDimsViaSlicesPatternsOp : Op<Transform_Dialect,
let assemblyFormat = "attr-dict";
}
+def ApplyLinalgCanonicalizationPatternsOp : Op<Transform_Dialect,
----------------
rengolin wrote:
So, this would be a larger change than this fixup.
First, because the transform is now generic, I need to make sure that the dialect requested is loaded, and if not, decide whether we want to load or err.
Second, the `getCanonicalizationPatterns` doesn't include the operations, which is then collected via `getRegisteredOperations`. If we want to only include patterns from a single dialect, we can't also bring all registered operations, but only those from the dialect. Currently, in Linalg, this is done via the template helper and the `inc` file. We'd have to replicate the pattern across all other dialects for this to be generic.
The best way I think would be to change `getCanonicalizationPatterns` to also collect the operations (upon an optional flag) and not need the `getRegisteredOperations` at all.
So, there are three ways we can proceed:
1. (Conservative) Don't add the new transform. I can remove the added code and just leave the refactor.
2. (Temporary) Leave the new transform as is, and later refactor (probably removing the transform).
3. (Promote) Do the whole change proposed above in this PR. This would likely need a new RFC.
My opinion is to do (1), the conservative and not add anything that we'd have to remove later. After we merge this I can create an RFC on this and we continue there.
https://github.com/llvm/llvm-project/pull/182909
More information about the Mlir-commits
mailing list