[Mlir-commits] [mlir] [mlir] Enhance dimOp fold (PR #187286)
Hocky Yudhiono
llvmlistbot at llvm.org
Sun Mar 22 20:58:32 PDT 2026
hockyy wrote:
> > These should not be in canonicalizations.
>
> I don't quite see why? If we can do it, why wouldn't we do it?
Should we move this into somewhere else?
The current dependency is weird. Proper `DimOp` folding should be done with Reify interface. But currently there's a pass `MLIRMemRefTransforms` that can fold `tensor::DimOp` as well.
This is a known TODO
```
struct DimOfShapedTypeOpInterface : public OpRewritePattern<OpTy> {
using OpRewritePattern<OpTy>::OpRewritePattern;
....
};
```
https://github.com/llvm/llvm-project/blob/c911b8492374942bf4cfe35411e90a35d3837f6a/mlir/lib/Dialect/MemRef/Transforms/ResolveShapedTypeResultDims.cpp#L190
https://github.com/llvm/llvm-project/pull/187286
More information about the Mlir-commits
mailing list