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

llvm-svn: 244622
This commit is contained in:
Teresa Johnson 2015-08-11 16:26:41 +00:00
parent a48040f787
commit c4279a7fb2
1 changed files with 3 additions and 0 deletions

View File

@ -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());