sbinabdullah commented on code in PR #19978:
URL: https://github.com/apache/tvm/pull/19978#discussion_r3562945390


##########
src/arith/const_int_bound.cc:
##########
@@ -273,15 +273,40 @@ class ConstIntBoundAnalyzer::Impl : public 
ExprFunctor<ConstIntBoundAnalyzer::En
     if (b.min_value > 0) {
       int64_t b_max_cap = InfAwareAdd(b.max_value, -1);
 
+      // Interval-based bound of the truncated mod.
+      Entry interval_bound;
+      if (a.min_value >= 0) {
+        // 0 <= [a_min, a_max] < b_min
+        if (a.max_value < b.min_value) {
+          interval_bound = a;
+        } else {
+          // other case, we can get close to 0
+          interval_bound = MakeBound(0, std::min(a.max_value, b_max_cap));
+        }
+      } else {
+        interval_bound = MakeBound(std::max(a.min_value, -b_max_cap),

Review Comment:
   really good catch I think you’re right. will add an additional check for 
this. 



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