[Mlir-commits] [mlir] [mlir][memref] Add a new `ReifyResultShapes` pass (PR #145927)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 30 11:11:37 PDT 2025
MaheshRavishankar wrote:
I looked through the original "canonicalization" PR <https://github.com/llvm/llvm-project/pull/145732> . This has the same issue that I am raising here. The `reifyResultShape` has more information about the op shapes than the op itself. That cannot be the case (we can all talk about not having enough documentation of things, and for sure lets fix documentation whenever something is not clear).
The right ordering here would be a pattern that would do what is done in the `reify` method here https://github.com/llvm/llvm-project/blob/01d0171e7a955deff032bed3ac1b7e51d98ce4a9/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp#L3811 (that could be run as part of canonicalization), and the `reify` method just gets the information from the operation. The operation has to be the source of information here.
If you want me to stamp this as a WIP/to-be-evolved thing, thats fine, but it is relying on what I see as an inverted dependence structure between the op and the interface method. I would have raised this on the implementation of the `reifyResultShape` to begin with if it hadnt sent/reviewed/landed before anyone from a different time zone had any chance to review it.
https://github.com/llvm/llvm-project/pull/145927
More information about the Mlir-commits
mailing list