From d2f35ebe96e65d285ca2c721d728817aaa4f167f Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Tue, 4 Apr 2023 04:10:00 +0900 Subject: [PATCH 1/2] use sinfo from Call instead of callee func in Runcodegen --- src/relax/transform/run_codegen.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/relax/transform/run_codegen.cc b/src/relax/transform/run_codegen.cc index 5c6b9852029b..25867419a99e 100644 --- a/src/relax/transform/run_codegen.cc +++ b/src/relax/transform/run_codegen.cc @@ -93,7 +93,8 @@ class CodeGenRunner : ExprMutator { Expr new_func = VisitExpr(func); if (new_func->IsInstance()) { - extern_funcs_[gvar_node] = {new_func, func->ret_struct_info}; + auto ret_sinfo = GetStructInfo(call); + extern_funcs_[gvar_node] = {new_func, ret_sinfo}; // Remove the global symbol and codegen attributes from the function so that it can be // removed the module. static const runtime::PackedFunc* RemoveFuncAttrFunc = @@ -102,7 +103,7 @@ class CodeGenRunner : ExprMutator { func = (*RemoveFuncAttrFunc)(func, tvm::attr::kGlobalSymbol); func = (*RemoveFuncAttrFunc)(func, attr::kCodegen); builder_->UpdateFunction(gvar, func); - return create_call_dps_packed(new_func, func->ret_struct_info); + return create_call_dps_packed(new_func, ret_sinfo); } } } From a3f912b445fb1797e2cfddb57792d13b60f63b25 Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Tue, 4 Apr 2023 04:21:07 +0900 Subject: [PATCH 2/2] format --- src/relax/transform/run_codegen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relax/transform/run_codegen.cc b/src/relax/transform/run_codegen.cc index 25867419a99e..fa726b82af2f 100644 --- a/src/relax/transform/run_codegen.cc +++ b/src/relax/transform/run_codegen.cc @@ -93,7 +93,7 @@ class CodeGenRunner : ExprMutator { Expr new_func = VisitExpr(func); if (new_func->IsInstance()) { - auto ret_sinfo = GetStructInfo(call); + auto ret_sinfo = GetStructInfo(call); extern_funcs_[gvar_node] = {new_func, ret_sinfo}; // Remove the global symbol and codegen attributes from the function so that it can be // removed the module.