From commits-return-16104-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Tue Jun 23 15:09:31 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6C0381804BB for ; Tue, 23 Jun 2020 17:09:31 +0200 (CEST) Received: (qmail 47640 invoked by uid 500); 23 Jun 2020 15:09:30 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 47631 invoked by uid 99); 23 Jun 2020 15:09:30 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2020 15:09:30 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_jcf94_commented_on_a_change_in_pu?= =?utf-8?q?ll_request_=235898=3A_GPU_related_bug_fix_=26_Improve?= Message-ID: <159292497073.8807.17787694808134003786.asfpy@gitbox.apache.org> Date: Tue, 23 Jun 2020 15:09:30 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: jcf94 commented on a change in pull request #5898: URL: https://github.com/apache/incubator-tvm/pull/5898#discussion_r444299222 ########## File path: src/arith/rewrite_simplify.cc ########## @@ -865,6 +900,28 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const FloorModNode* op) { TVM_TRY_REWRITE_IF(floormod(x + y * c1, c2), floormod(x, c2), c2.Eval()->value > 0 && c1.Eval()->value % c2.Eval()->value == 0); + TVM_TRY_REWRITE_IF(floormod(x * c1 + y, c2), floormod(x, floordiv(c2, c1)) * c1 + y, + c1.Eval()->value > 0 && c2.Eval()->value > 0 && + c2.Eval()->value % c1.Eval()->value == 0 && + CanProveGreaterEqual(-y.Eval(), -c1.Eval()->value + 1)); + + // TODO(jcf94): For the next two rules, better use the max common factor + // of c1, c2, c3 to do the simplification Review comment: Emm ... Unfortunately these rules seemed to cause another simplify error int the UT(see jenkins tests), I'll try to see if we can figure out a better way rule to solve it fine. ---------------------------------------------------------------- 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