Skip to content

Commit e28b510

Browse files
authored
Add VisitStmt_ method for AssertStmtNode and StringImmNode (#18389)
1 parent 2edc9b3 commit e28b510

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/tir/analysis/estimate_flops.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,20 @@ class FlopEstimator : private ExprFunctor<TResult(const PrimExpr& n)>,
193193
return cond;
194194
}
195195

196+
TResult VisitStmt_(const AssertStmtNode* op) override {
197+
TResult result = VisitExpr(op->condition);
198+
if (op->message.defined()) {
199+
result += VisitExpr(op->message);
200+
}
201+
result += VisitStmt(op->body);
202+
return result;
203+
}
204+
196205
TResult VisitExpr_(const VarNode* op) override { return TResult(); }
197206
TResult VisitExpr_(const SizeVarNode* op) override { return TResult(); }
198207
TResult VisitExpr_(const IntImmNode* op) override { return TResult(); }
199208
TResult VisitExpr_(const FloatImmNode* op) override { return TResult(); }
209+
TResult VisitExpr_(const StringImmNode* op) override { return TResult(); }
200210
TResult VisitExpr_(const CastNode* op) override { return VisitExpr(op->value); }
201211
TResult VisitStmt_(const AllocateConstNode* op) override { return VisitStmt(op->body); }
202212
TResult VisitStmt_(const AllocateNode* op) override { return VisitStmt(op->body); }

0 commit comments

Comments
 (0)