You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/11/14 21:13:54 UTC

[GitHub] [incubator-tvm] wweic commented on a change in pull request #4334: [Relay][Pass] Add pass to remove unused functions in relay module

wweic commented on a change in pull request #4334: [Relay][Pass] Add pass to remove unused functions in relay module
URL: https://github.com/apache/incubator-tvm/pull/4334#discussion_r346548590
 
 

 ##########
 File path: src/relay/backend/vm/compiler.cc
 ##########
 @@ -863,6 +864,8 @@ void VMCompiler::Compile(Module mod,
 
 Module VMCompiler::OptimizeModule(const Module& mod, const TargetsMap& targets) {
   Array<Pass> pass_seqs;
+  Array<tvm::Expr> entry_functions{tvm::Expr{"main"}};
+  pass_seqs.push_back(transform::RemoveUnusedFunctions(entry_functions));
 
 Review comment:
   This is a good idea, we can run it twice begin and end. But I check `InlinePrimitives`, it doesn't seem to inline identity function in test `test_remove_all_prelude_functions_but_referenced_functions`. I can fix it later.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services