This is an automated email from the ASF dual-hosted git repository.
tlopex 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 e28b510ae2 Add VisitStmt_ method for AssertStmtNode and StringImmNode
(#18389)
e28b510ae2 is described below
commit e28b510ae234f4fa58056bdd62a00e68488a3727
Author: Qingchao Shen <[email protected]>
AuthorDate: Sat Oct 25 05:16:44 2025 +0800
Add VisitStmt_ method for AssertStmtNode and StringImmNode (#18389)
---
src/tir/analysis/estimate_flops.cc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/tir/analysis/estimate_flops.cc
b/src/tir/analysis/estimate_flops.cc
index 3dca26749b..3fe33cdf2a 100644
--- a/src/tir/analysis/estimate_flops.cc
+++ b/src/tir/analysis/estimate_flops.cc
@@ -193,10 +193,20 @@ class FlopEstimator : private ExprFunctor<TResult(const
PrimExpr& n)>,
return cond;
}
+ TResult VisitStmt_(const AssertStmtNode* op) override {
+ TResult result = VisitExpr(op->condition);
+ if (op->message.defined()) {
+ result += VisitExpr(op->message);
+ }
+ result += VisitStmt(op->body);
+ return result;
+ }
+
TResult VisitExpr_(const VarNode* op) override { return TResult(); }
TResult VisitExpr_(const SizeVarNode* op) override { return TResult(); }
TResult VisitExpr_(const IntImmNode* op) override { return TResult(); }
TResult VisitExpr_(const FloatImmNode* op) override { return TResult(); }
+ TResult VisitExpr_(const StringImmNode* op) override { return TResult(); }
TResult VisitExpr_(const CastNode* op) override { return
VisitExpr(op->value); }
TResult VisitStmt_(const AllocateConstNode* op) override { return
VisitStmt(op->body); }
TResult VisitStmt_(const AllocateNode* op) override { return
VisitStmt(op->body); }