[Mlir-commits] [mlir] [MLIR][Tensor] Remove FoldDimOf[Expand|Collapse]Shape Pattern (PR #134219)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Apr 8 10:01:07 PDT 2025


MaheshRavishankar wrote:

> > None of the other tensor.dim resolution patterns are run during canonicalizations. They have non-local effects that might be too hard a hammer for canonicalizations, and was removed from canonicalizations a really long time ago.
> 
> I don't see the non-local effects on the current test change, can you elaborate on this please? Maybe an example showing the effect of this canonicalization pattern that shouldn't be a canonicalization?
> 
> (I'd rather see this resolved before anyone merges this)

Let me clarify. These patterns are the outliers. None of the other `tensor.dim` resolution patterns are run during canonicalization. These pattern are also wrong and redundant. I see no reason to fix these patterns cause they are inconsistent, and duplicate of the tensor.dim resolution that happens through interface [here](https://github.com/llvm/llvm-project/blob/a54736afd5b8f8ed25550a9f456afd36e49c04e0/mlir/lib/Dialect/Tensor/IR/TensorInferTypeOpInterfaceImpl.cpp#L129). So the resolution here is to remove this pattern. The question of whether all the tensor.dim resolution needs to happen during canonicalization or not is a separate issue that we can revisit. 



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


More information about the Mlir-commits mailing list