From: Teresa Johnson Date: Tue, 11 Aug 2015 16:26:41 +0000 (+0000) Subject: Enable EliminateAvailableExternally pass in the LTO pipeline. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=84ee0a28453206b0b3ecd83c1d18d57c9aeb6e54;p=oota-llvm.git Enable EliminateAvailableExternally pass in the LTO pipeline. Summary: For LTO we need to enable this pass in the LTO pipeline, as it is skipped during the "-flto -c" compile step (when PrepareForLTO is set). Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11919 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244622 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp index a4a1852de30..9f58b49288a 100644 --- a/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -556,6 +556,9 @@ void PassManagerBuilder::addLateLTOOptimizationPasses( // Delete basic blocks, which optimization passes may have killed. PM.add(createCFGSimplificationPass()); + // Drop bodies of available externally objects to improve GlobalDCE. + PM.add(createEliminateAvailableExternallyPass()); + // Now that we have optimized the program, discard unreachable functions. PM.add(createGlobalDCEPass());