tqchen commented on a change in pull request #7084:
URL: https://github.com/apache/tvm/pull/7084#discussion_r544769579
##########
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:
It is important to take the context into consideration. For the checks
that would leads to a user facing error, e.g. the API expects inputs of two
elements but only get one, a more comprehensive error message should be used --
and we should use CHECK instead of ICHECK in the user facing API part.
In cases like this one, this is an invariant, and we could give the
developer the freedom to choose the appropriate error message, since the ease
of development is also another factor we want to balance.
----------------------------------------------------------------
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]