Skip to content

Commit ecf0347

Browse files
committed
use control function
1 parent 79ff60b commit ecf0347

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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 =

0 commit comments

Comments
 (0)