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/07/16 00:13:38 UTC

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #6043: [ARITH] Improve vector simplification for float operands

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



##########
File path: src/arith/rewrite_simplify.cc
##########
@@ -133,6 +135,7 @@ PrimExpr RewriteSimplifier::Impl::VisitExpr_(const AddNode* op) {
     TVM_TRY_REWRITE(ramp(b1, s1, lanes) + broadcast(x, lanes), ramp(b1 + x, s1, lanes));
     TVM_TRY_REWRITE(broadcast(x, lanes) + ramp(b1, s1, lanes), ramp(x + b1, s1, lanes));
     TVM_TRY_REWRITE(broadcast(x, lanes) + broadcast(y, lanes), broadcast(x + y, lanes));
+    TVM_TRY_REWRITE_IF(x + broadcast(c4, lanes), x, std::fabs(c4.Eval()->value) < 1e-20);

Review comment:
       can we simply use equal instead if we just want to check 0?




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