gemini-code-assist[bot] commented on code in PR #19604:
URL: https://github.com/apache/tvm/pull/19604#discussion_r3299749329


##########
src/tirx/transform/stmt_simplify.cc:
##########
@@ -34,50 +34,35 @@
 #include <tvm/tirx/op.h>
 #include <tvm/tirx/transform.h>
 
-#include <optional>
-
 #include "../../arith/ir_mutator_with_analyzer.h"
-#include "../../tirx/analysis/control_flow_graph.h"
 
 namespace tvm {
 namespace arith {
 
 using namespace tirx;
 
-struct SimplifyConfigNode : public AttrsNodeReflAdapter<SimplifyConfigNode> {
+struct StmtSimplifyConfigNode : public 
AttrsNodeReflAdapter<StmtSimplifyConfigNode> {
   bool transitively_prove_inequalities;
-  bool propagate_knowns_to_prove_conditional;
-  bool propagate_knowns_to_simplify_expressions;
   bool convert_boolean_to_and_of_ors;
   bool apply_constraints_to_boolean_branches;
 
   static void RegisterReflection() {
     namespace refl = tvm::ffi::reflection;
-    refl::ObjectDef<SimplifyConfigNode>()
+    refl::ObjectDef<StmtSimplifyConfigNode>()
         .def_ro("transitively_prove_inequalities",
-                &SimplifyConfigNode::transitively_prove_inequalities,
+                &StmtSimplifyConfigNode::transitively_prove_inequalities,
                 "If true, simplify conditionals with transitive combinations 
of scoped constraints",
                 refl::DefaultValue(false))
-        .def_ro(
-            "propagate_knowns_to_prove_conditional",
-            &SimplifyConfigNode::propagate_knowns_to_prove_conditional,
-            "If true, known buffer values are propagated and used to 
statically prove conditionals",
-            refl::DefaultValue(false))
-        .def_ro(
-            "propagate_knowns_to_simplify_expressions",
-            &SimplifyConfigNode::propagate_knowns_to_simplify_expressions,
-            "If true, known buffer values are propagated and used to replace 
BufferLoad wherever "
-            "possible",
-            refl::DefaultValue(false))
-        .def_ro("convert_boolean_to_and_of_ors", 
&SimplifyConfigNode::convert_boolean_to_and_of_ors,
+        .def_ro("convert_boolean_to_and_of_ors",
+                &StmtSimplifyConfigNode::convert_boolean_to_and_of_ors,
                 "If true, simplify conditionals into an AND of ORs", 
refl::DefaultValue(false))
         .def_ro("apply_constraints_to_boolean_branches",
-                &SimplifyConfigNode::apply_constraints_to_boolean_branches,
+                &StmtSimplifyConfigNode::apply_constraints_to_boolean_branches,
                 "If true, simplify each branch of AND/OR under a constraints 
provided by the other "
                 "branch",
                 refl::DefaultValue(false));

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   There is a minor grammatical typo in the docstring for 
`apply_constraints_to_boolean_branches`. It says "under a constraints", which 
should be "under constraints".
   
   ```suggestion
           .def_ro("apply_constraints_to_boolean_branches",
                   
&StmtSimplifyConfigNode::apply_constraints_to_boolean_branches,
                   "If true, simplify each branch of AND/OR under constraints 
provided by the other "
                   "branch",
                   refl::DefaultValue(false));
   ```



##########
tests/python/tirx-transform/test_tir_transform_remove_no_op.py:
##########
@@ -242,30 +241,8 @@ def expected(A: T.Buffer(16, "int32")):
     tvm.ir.assert_structural_equal(mod["main"], expected)
 
 
-def test_remove_unused_write():
-    """For two sequential writes, the first is a no-op"""
-
-    @T.prim_func(private=True, s_tir=True)
-    def before(A: T.Buffer(16, "int32")):
-        for i in T.serial(16):
-            A[i] = 100
-            A[i] = 42
-
-    @T.prim_func(private=True, s_tir=True)
-    def expected(A: T.Buffer(16, "int32")):
-        for i in T.serial(16):
-            A[i] = 42
-
-    mod = tvm.IRModule.from_expr(before)
-    mod = _apply_remove_no_op(mod, use_dataflow_analysis=True)
-    tvm.ir.assert_structural_equal(mod["main"], expected)
-
-
 def test_suppress_removal_of_unused_write():
-    """Dataflow analysis requires the config to opt-in
-
-    Like test_remove_unused_write, but dataflow analysis isn't enabled.
-    """
+    """Sequential writes to the same location are not removed without dataflow 
analysis."""

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Since `ControlFlowGraph` and the `use_dataflow_analysis` option have been 
completely phased out in this PR, the docstring mentioning "without dataflow 
analysis" is slightly outdated. It is better to clarify that dataflow analysis 
is no longer supported.
   
   ```suggestion
       """Sequential writes to the same location are not removed because 
dataflow analysis is no longer supported."""
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to