Skip to content

Commit 54a7f1d

Browse files
authored
Backport a fix for the simpler bug in lossless_cast (#8264)
Fix the simpler bug in lossless_cast The full fix to lossless_cast is too complicated to backport
1 parent 5254117 commit 54a7f1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IROperator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Expr lossless_cast(Type t, Expr e) {
502502
Expr a = lossless_cast(t.narrow(), sub->a);
503503
Expr b = lossless_cast(t.narrow(), sub->b);
504504
if (a.defined() && b.defined()) {
505-
return cast(t, a) + cast(t, b);
505+
return cast(t, a) - cast(t, b);
506506
} else {
507507
return Expr();
508508
}

0 commit comments

Comments
 (0)