tqchen commented on a change in pull request #7084:
URL: https://github.com/apache/tvm/pull/7084#discussion_r544730063
##########
File path: src/tir/transforms/make_packed_api.cc
##########
@@ -41,6 +41,56 @@
namespace tvm {
namespace tir {
+class ReturnRewriter : public StmtMutator {
+ public:
+ explicit ReturnRewriter(Var ret_var, Var ret_tcode) : ret_var_(ret_var),
ret_tcode_(ret_tcode) {}
+
+ Stmt VisitStmt_(const EvaluateNode* node) override {
+ Stmt ret = StmtMutator::VisitStmt_(node);
+ const EvaluateNode* eval = ret.as<EvaluateNode>();
+ CHECK(eval);
Review comment:
Thanks @tkonolige.
In this particular case, the error message point to this line, and by
looking around the context, one line above, we know that the error is caused by
the type, so the context gives enough info. Notably, from the impl of
StmtMutator this is an internal error that won't trigger and the check here is
mainly a reasonable check.
I agree that in some other cases the context is certainly not enough for
debug, and having a better error message would help. While adding error
messages is certainly fine in this case, I do think not putting constraint on
development in this particular case is helpful and @ZihengJiang can make the
decision of what level of error message to be put in this internal check.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]