File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -18885,6 +18885,9 @@ struct ReduceReduce final
1888518885 return rewriter.notifyMatchFailure(
1888618886 op, "reduce op has more than one input. not yet supported");
1888718887
18888+ if (!llvm::hasSingleElement(op.getInputs()[0].getUses()))
18889+ return failure();
18890+
1888818891 if (!OperationEquivalence::isEquivalentTo(
1888918892 redOp.getInitValues()[0].getDefiningOp(),
1889018893 op.getInitValues()[0].getDefiningOp(),
@@ -18927,6 +18930,7 @@ struct ReduceReduce final
1892718930 rewriter.inlineRegionBefore(redOp.getBody(), newReduceOp.getBody(),
1892818931 newReduceOp.getBody().end());
1892918932 rewriter.replaceOp(op, newReduceOp.getResult(0));
18933+ rewriter.eraseOp(redOp);
1893018934 return success();
1893118935 }
1893218936};
You can’t perform that action at this time.
0 commit comments