Lunderberg commented on code in PR #17158:
URL: https://github.com/apache/tvm/pull/17158#discussion_r1679736063


##########
src/arith/rewrite_simplify.cc:
##########
@@ -697,7 +698,7 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const SubNode* 
op) {
     TVM_TRY_RECURSIVE_REWRITE(x - (y + c1), (x - y) + (0 - c1));
     TVM_TRY_RECURSIVE_REWRITE(x - (y - z), (x + z) - y);
     TVM_TRY_RECURSIVE_REWRITE(x - y * c1, x + y * (0 - c1));
-  } else if (op->dtype.is_float()) {
+  } else {

Review Comment:
   Some of the rewrite rules in the `IsIndexDType` branch assume that overflow 
won't occur.  While this isn't guaranteed to be true, we're more likely to get 
overflow for small integer types than for the 32/64-bit signed integers used 
for index dtypes.
   
   For the uint16/uint8 types seen in https://github.com/apache/tvm/pull/17149, 
it would be a lot easier to get accidental overflow.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to