[Mlir-commits] [mlir] [mlir][memref] Add a new `ReifyResultShapes` pass (PR #145927)

Fabian Mora llvmlistbot at llvm.org
Thu Jun 26 13:08:33 PDT 2025


fabianmcg wrote:

> This seems to be similar to https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/MemRef/Transforms/ResolveShapedTypeResultDims.cpp . What is this doing on top of that pass?

They are not exactly similar.
`ResolveShapedTypeResultDims` looks for dims and reifies when they are present.
In this pass we reify ops independent if there's a dim or not. That's why the `pad` test in tests is not modified by `ResolveShapedTypeResultDims`, but is correctly handled by this pass.

Also, just noticed that this pattern is wrong: https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/MemRef/Transforms/ResolveShapedTypeResultDims.cpp#L57-L59

It has the potential of returning `failure` after having modified the IR, violating the contracts stablished with the rewriter. That's also the main reason this pass doesn't use patterns, as we would need a rollback rewriter.


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


More information about the Mlir-commits mailing list