Aleksei-grovety commented on code in PR #14532:
URL: https://github.com/apache/tvm/pull/14532#discussion_r1168474851
##########
src/tir/analysis/control_flow_graph.h:
##########
@@ -399,7 +399,8 @@ class ControlFlowGraph {
public:
/* \brief Extract the touch pattern from a TIR statement
*/
- explicit ControlFlowGraph(const Stmt& stmt, size_t max_revisits = 5);
+ explicit ControlFlowGraph(const Stmt& stmt, int max_simplification_steps = 0,
Review Comment:
Parameter max_simplification_steps that is passed here from structure
RemoveNoOpConfigNode uses int64_t, but here int.
##########
src/arith/rewrite_simplify.h:
##########
@@ -39,6 +40,41 @@ namespace arith {
using namespace tir;
+/* Record of
Review Comment:
missed \brief
##########
src/arith/rewrite_simplify.h:
##########
@@ -87,9 +125,29 @@ class RewriteSimplifier::Impl : public
IRMutatorWithAnalyzer {
/*! \brief Return the currently enabled extensions */
Extension GetEnabledExtensions() const;
+ RewriteSimplifierStats GetStatsCounters() const { return
RewriteSimplifierStats(stats_); }
+
+ void ResetStatsCounters() { stats_ = {}; }
+
+ void SetMaximumRewriteSteps(int64_t maximum) { maximum_rewrite_steps_ =
maximum; }
+
protected:
+ int64_t maximum_rewrite_steps_{0};
+ RewriteSimplifierStatsNode stats_;
+
+ void RecordAttemptedRewrite() { stats_.rewrites_attempted++; }
+ void RecordRewrite() {
+ stats_.rewrites_performed++;
+
+ ICHECK(maximum_rewrite_steps_ <= 0 || stats_.rewrites_performed <=
maximum_rewrite_steps_)
+ << "RewriteSimplifier exceeded maximum number of rewrites allowed ("
+ << maximum_rewrite_steps_ << ")";
+ }
+
+ bool is_currently_visiting_{false};
Review Comment:
variable is not used
--
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]