ekalda commented on code in PR #17046:
URL: https://github.com/apache/tvm/pull/17046#discussion_r1621053987


##########
src/arith/rewrite_simplify.cc:
##########
@@ -1136,8 +1136,15 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const 
FloorDivNode* op) {
                        x + floordiv(y, z), CanProveGreaterEqual(z.Eval(), 0));
     TVM_TRY_REWRITE_IF(matches_one_of(floordiv(y + x * z, z), floordiv(y + z * 
x, z)),
                        floordiv(y, z) + x, CanProveGreaterEqual(z.Eval(), 0));
+    TVM_TRY_REWRITE_IF(floordiv(x * z * c1 + y, z * c1), x + floordiv(y, z * 
c1),
+                       CanProveGreaterEqual(z.Eval() * c1.Eval(), 0));

Review Comment:
   I'd lean towards option 3, it's pretty straightforward to implement (it can 
even just be a wrapper around 1). WDYT? 
   
   To me it is a bit arbitrary that `CanProveLess` and `CanProveGreaterEqual` 
don't have same powers as `CanProve` and `CanProveEqual`, but I suppose the 
tradeoffs there are a topic of another discussion :) 



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