You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by wu...@apache.org on 2022/11/30 18:28:51 UTC

[tvm] branch main updated: [TIR] Disable RewriteSimplifier extensions in RemoveNoOp (#13524)

This is an automated email from the ASF dual-hosted git repository.

wuwei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 6782a35018 [TIR] Disable RewriteSimplifier extensions in RemoveNoOp (#13524)
6782a35018 is described below

commit 6782a35018d5df63486569f17296737d75eedc55
Author: Eric Lunderberg <Lu...@users.noreply.github.com>
AuthorDate: Wed Nov 30 12:28:42 2022 -0600

    [TIR] Disable RewriteSimplifier extensions in RemoveNoOp (#13524)
    
    During a `tir.Simplify` pass, these extensions were conditionally
    enabled based on the `PassContext`.  Prior to this commit, they were
    enabled by default in the `tir.RemoveNoOp` pass, as the simplified
    expressions were only used to prove/disprove a no-op, and did not
    appear in the output TIR.  However, this caused performance issues for
    some nested boolean expressions.
    
    This PR disables the analyzer extensions for the analyzer used by
    `tir.RemoveNoOp`.  The extensions are still used internally by
    `ControlFlowGraph`, including during the data-flow analysis used if
    `tir.transform.RemoveNoOpConfig.use_dataflow_analysis` is enabled, so
    the opt-in data-dependent no-op removals are unaffected.
    
    Related to issue #13508.
---
 src/tir/transforms/remove_no_op.cc | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/tir/transforms/remove_no_op.cc b/src/tir/transforms/remove_no_op.cc
index 3374f975f5..52468e73d4 100644
--- a/src/tir/transforms/remove_no_op.cc
+++ b/src/tir/transforms/remove_no_op.cc
@@ -306,10 +306,6 @@ Pass RemoveNoOp() {
     }
 
     arith::Analyzer analyzer;
-    analyzer.rewrite_simplify.SetEnabledExtensions(arith::RewriteSimplifier::Extension(
-        arith::RewriteSimplifier::kTransitivelyProveInequalities |
-        arith::RewriteSimplifier::kConvertBooleanToAndOfOrs |
-        arith::RewriteSimplifier::kApplyConstraintsToBooleanBranches));
 
     auto* n = f.CopyOnWrite();
     n->body = NoOpRemover::Apply(std::move(n->body), &analyzer, std::move(touch_pattern), nullptr);