File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
mlir/lib/Dialect/Linalg/Transforms Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -974,6 +974,11 @@ class FoldPadWithProducerReshapeOpByExpansion
974974 if (!reshapeOp->hasOneUse ())
975975 return failure ();
976976
977+ if (!controlFoldingReshapes (&padOp.getSourceMutable ())) {
978+ return rewriter.notifyMatchFailure (padOp,
979+ " fusion blocked by control function" );
980+ }
981+
977982 ArrayRef<int64_t > low = padOp.getStaticLow ();
978983 ArrayRef<int64_t > high = padOp.getStaticHigh ();
979984 SmallVector<ReassociationIndices> reassociations =
@@ -1778,6 +1783,11 @@ class FoldPadWithProducerReshapeOpByCollapsing
17781783 if (!reshapeOp->hasOneUse ())
17791784 return failure ();
17801785
1786+ if (!controlFoldingReshapes (&padOp.getSourceMutable ())) {
1787+ return rewriter.notifyMatchFailure (padOp,
1788+ " fusion blocked by control function" );
1789+ }
1790+
17811791 ArrayRef<int64_t > low = padOp.getStaticLow ();
17821792 ArrayRef<int64_t > high = padOp.getStaticHigh ();
17831793 SmallVector<ReassociationIndices> reassociations =
You can’t perform that action at this time.
0 commit comments