tqchen commented on code in PR #18694:
URL: https://github.com/apache/tvm/pull/18694#discussion_r2741741410


##########
src/tir/transforms/lower_intrin.cc:
##########
@@ -118,10 +118,11 @@ class IntrinInjecter : public 
tvm::arith::IRMutatorWithAnalyzer {
 
       // If the numerator's lower bound is known, express the floordiv
       // in terms of truncdiv using only positive operands.
-      arith::ConstIntBound const_int_bound = analyzer_->const_int_bound(op->a);
-      if (const_int_bound->min_value < 0 &&
-          const_int_bound->min_value >
-              
-(Downcast<IntImm>(tvm::max_value(op->a->dtype.element_of()))->value)) {
+      arith::ConstIntBound const_int_bound_a = 
analyzer_->const_int_bound(op->a);
+      arith::ConstIntBound const_int_bound_b = 
analyzer_->const_int_bound(op->b);

Review Comment:
   would be great to explicitly list out 
`(Downcast<IntImm>(tvm::max_value(op->a->dtype.element_of()))->value)` as a 
variable and have comment documenting why +2 is needed, so future changes have 
the right context



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to