Skip to content

Commit 8f479a4

Browse files
committed
Update comment and message about folding cast where the input has multiple uses
1 parent 2b2e860 commit 8f479a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,11 +981,11 @@ struct TosaFoldConstantCast : public TosaFoldConstantBase<CastOp> {
981981
warnAboutNaNToIntCast(elements, tosaCast, rewriter);
982982

983983
// Only fold splat tensors and those used only once to avoid duplicating
984-
// them.
984+
// them and increasing memory consumption.
985985
if (!inputTensor.hasOneUse() && !isa<SplatElementsAttr>(elements)) {
986-
return rewriter.notifyMatchFailure(tosaCast,
987-
"Currently, casts will only be folded "
988-
"if its input only has a single user");
986+
return rewriter.notifyMatchFailure(
987+
tosaCast, "Currently, casts will only be folded "
988+
"if its input only has a single user or is a splat value.");
989989
}
990990

991991
// Report a match failure for unexpected types

0 commit comments

Comments
 (0)