tqchen commented on code in PR #20018:
URL: https://github.com/apache/tvm/pull/20018#discussion_r3596091334


##########
src/tirx/ir/stmt_functor.cc:
##########
@@ -59,6 +59,8 @@ void StmtVisitor::VisitStmt_(const WhileNode* op) {
   this->VisitStmt(op->body);
 }
 
+void StmtVisitor::VisitStmt_(const ReturnNode* op) { 
this->VisitExpr(op->value); }

Review Comment:
   Thanks for flagging this. In TIRx, StmtVisitor does define the protected 
virtual VisitExpr(const Expr&) hook in include/tvm/tirx/stmt_functor.h, and 
StmtExprVisitor overrides it to delegate to ExprVisitor. StmtMutator likewise 
defines VisitExpr, while StmtExprMutator overrides it to delegate to 
ExprMutator. The Return handlers therefore belong in StmtVisitor and 
StmtMutator, matching Evaluate and the other expression-bearing statements; 
recursive StmtExpr traversal and mutation reach Return.value through those 
hooks. The exact PR head builds successfully, the focused Return functor tests 
pass (19/19), and the complete storage-rewrite suite passes (14/14), so no code 
change is needed here.



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