@@ -880,8 +880,10 @@ struct FoldProducerReshapeOpByLinearization
880
880
881
881
// Further check that the resulting index maps can be fused and
882
882
// inverted. Without this the resultant op is not legal.
883
- if (!inversePermutation (concatAffineMaps (fusedIndexMaps)))
884
- return op.emitRemark (" fused op loop bound computation failed" );
883
+ if (!inversePermutation (concatAffineMaps (fusedIndexMaps))) {
884
+ return rewriter.notifyMatchFailure (
885
+ op, " fused op loop bound computation failed" );
886
+ }
885
887
886
888
rewriter.startRootUpdate (op);
887
889
op->setOperands (fusedOperands);
@@ -973,15 +975,19 @@ struct FoldConsumerReshapeOpByLinearization
973
975
linearizeCollapsedDims (invMap, reshapeOp.getSrcType ().getShape (),
974
976
reshapeOp.getReassociationMaps ());
975
977
for (AffineExpr expr : modifiedMap.getResults ()) {
976
- if (!expr.isPureAffine ())
977
- return producer.emitRemark (" fused op indexing map is not affine" );
978
+ if (!expr.isPureAffine ()) {
979
+ return rewriter.notifyMatchFailure (
980
+ producer, " fused op indexing map is not affine" );
981
+ }
978
982
}
979
983
fusedIndexMaps.back () = modifiedMap;
980
984
981
985
// Further check that the resulting index maps can be fused and
982
986
// inverted. Without this the resultant op is not legal.
983
- if (!inversePermutation (concatAffineMaps (fusedIndexMaps)))
984
- return reshapeOp.emitRemark (" fused op loop bound computation failed" );
987
+ if (!inversePermutation (concatAffineMaps (fusedIndexMaps))) {
988
+ return rewriter.notifyMatchFailure (
989
+ producer, " fused op loop bound computation failed" );
990
+ }
985
991
986
992
Location loc = producer.getLoc ();
987
993
Value output = rewriter.create <TensorReshapeOp>(
0 commit comments