[Mlir-commits] [mlir] [mlir][tensor] Add a PadOp::FoldReifiedShape canonicalization (PR #145732)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Fri Jun 27 01:50:58 PDT 2025
ftynse wrote:
> I think we have had multiple of these sessions. Happy to chat offline to give context, but Tl;DR is MLIR canonicalizations have become too much of a kitchen sink and we should avoid. What we need are fixed point iterations that do a specific transformation of the program. For example, the tensor.cast resolution is a well defined fixed point (unfortunately this is today bundled into canonicalizer and should be removed IMO). tensor.dim resolution is a well defined fixed point which is done with [populateResolveRankedShapedTypeResultDimsPatterns](https://github.com/llvm/llvm-project/blob/a0c5f1992d2188dd58987445aa00a55edad2357f/mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h#L52%60) .
Yeah, what I'd like to have is to have outcomes of these discussions documented and saved somewhere for the broader community. It may feel like more work, but it is actually less if scaled over time and people. Not having to re-discover what people have already seen and partly resolved.
On the technical concept, I think we have a strong alignment: specific properties of the IR are desired over a generic "canonicalization". This seems to be a dominant viewpoint by the way, just nobody took the time to share it.
https://github.com/llvm/llvm-project/pull/145732
More information about the Mlir-commits
mailing list