You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/22 17:33:15 UTC

[GitHub] [incubator-tvm] hzfan commented on a change in pull request #5367: Improve IntervalSet's floormod

hzfan commented on a change in pull request #5367:
URL: https://github.com/apache/incubator-tvm/pull/5367#discussion_r413175611



##########
File path: src/arith/const_int_bound.cc
##########
@@ -150,10 +150,12 @@ class ConstIntBoundAnalyzer::Impl :
       const PrimExprNode* op = expr.as<PrimExprNode>();
       auto val = bound_->find(op);
       if (val != bound_->end()) {
-        CHECK(val->second->min_value == res.min_value &&
-              val->second->max_value == res.max_value)
-          << "Detected bound for " << expr
-          << "conflicts with memorization";
+        auto everything = Everything(op->dtype);
+        CHECK(
+            (val->second->min_value == res.min_value && val->second->max_value == res.max_value) ||
+            (val->second->min_value == everything.min_value &&

Review comment:
       I guess this is for the case where `override == true`, right? If so, what about make it explicit and just checks if override is true? Or can we clear the whole memo map when updating with override?

##########
File path: src/arith/int_set.cc
##########
@@ -518,7 +533,14 @@ class IntervalSetEvaluator :
   // whether set is exactly single point that equals value.
   bool MatchPoint(const IntervalSet& set,
                   const PrimExpr& value) const {
-    return set->min_value.same_as(value) && set->max_value.same_as(value);
+    if (set->min_value.same_as(value) && set->max_value.same_as(value)) {

Review comment:
       Can we reuse `CanProve` here to check if `set->min_value == value && set->max_value == value`?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org