tqchen commented on a change in pull request #5772:
URL: https://github.com/apache/incubator-tvm/pull/5772#discussion_r442947630



##########
File path: src/arith/rewrite_simplify.cc
##########
@@ -353,6 +353,15 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const 
SubNode* op) {
         truncdiv(x + c1, c3) - truncdiv(x, c3), truncdiv(truncmod(x, c3) + c1, 
c3),
         CanProveGreaterEqual(x.Eval(), 0) && c1.Eval()->value >= 0 && 
c3.Eval()->value > 0);
 
+    TVM_TRY_REWRITE_IF(truncdiv(x * c1 + c2, c3) - truncdiv(x * c1 + c4, c3), 
truncdiv(c2 - c4, c3),
+                       c1.Eval()->value >= 0 && c2.Eval()->value > 0 && 
c3.Eval()->value > 0 &&

Review comment:
       Would be great if we can write down a proof for the rule. or a tabular 
validation. This rule is quite similar to the rule above(which translates into 
an additional truncmod), but this rule does not.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to