Unverified Commit 6798ba80 by abergeron Committed by GitHub

Make sure to visit the arguments of inlined functions (#4783)

parent 1b8522e4
......@@ -87,12 +87,22 @@ struct PrimitiveInliner : ExprMutator {
if (auto func = op.as<FunctionNode>()) {
if (func->IsPrimitive()) {
return CallNode::make(GetRef<Function>(func), call->args, call->attrs, call->type_args);
tvm::Array<Expr> call_args;
for (auto arg : call->args) {
auto new_arg = VisitExpr(arg);
call_args.push_back(new_arg);
}
return CallNode::make(GetRef<Function>(func), call_args, call->attrs, call->type_args);
}
}
if (auto global = op.as<GlobalVarNode>()) {
return CallNode::make(GetRef<GlobalVar>(global), call->args, call->attrs, call->type_args);
tvm::Array<Expr> call_args;
for (auto arg : call->args) {
auto new_arg = VisitExpr(arg);
call_args.push_back(new_arg);
}
return CallNode::make(GetRef<GlobalVar>(global), call_args, call->attrs, call->type_args);
}
return ExprMutator::VisitExpr_(call);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment