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 20:45:39 UTC

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

icemelon9 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_r346537041
 
 

 ##########
 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:
   I wonder if we should run this pass at the end of optimization. For example, some lambda lifted functions will be no longer used after they are inlined.

----------------------------------------------------------------
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