Skip to content

Commit dad4284

Browse files
[MLIR][Tensor] Remove FoldDimOf[Expand|Collapse]Shape Pattern
This commit removes the FoldDimOfExpandShape and FoldDimOfCollapseShape pattern from the list of ExpandShapeOp's canonicalization patterns. The above pattern were resulting in crash while folding the dims of an expanded tensor. The issue can be reproduced by undoing the changes done in this commit and by running the command: ``` mlir-opt --linalg-fuse-elementwise-ops repro.mlir ``` over the IR: https://gist.github.com/vivekkhandelwal1/56a1a398c21d739df77a67ce372b9366. Signed-off-by: Vivek Khandelwal <[email protected]>
1 parent b384d6d commit dad4284

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,8 +2158,7 @@ void ExpandShapeOp::getCanonicalizationPatterns(RewritePatternSet &results,
21582158
ComposeExpandOfCollapseOp<ExpandShapeOp, CollapseShapeOp>,
21592159
ConvertToStaticExpandShape, FoldReshapeWithConstant<ExpandShapeOp>,
21602160
FoldReshapeWithSplat<ExpandShapeOp>,
2161-
FoldReshapeWithFromElements<ExpandShapeOp>, FoldDimOfExpandShape,
2162-
FoldDimOfCollapseShape>(context);
2161+
FoldReshapeWithFromElements<ExpandShapeOp>>(context);
21632162
}
21642163

21652164
void CollapseShapeOp::getCanonicalizationPatterns(RewritePatternSet &results,

0 commit comments

Comments
 (0)