Skip to content

Commit

Permalink
[NewPassManager] Run global dead code elimination after the inliner.
Browse files Browse the repository at this point in the history
This is the same exact change we did for the current pass manager
in rL314997, but the new pass manager pipeline already happened
to run GlobalOpt after the inliner, so we just insert a run of
GDCE here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315003 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dcci committed Oct 5, 2017
1 parent 8689150 commit 6bfe1d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Passes/PassBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,

// Optimize globals now that the module is fully simplified.
MPM.addPass(GlobalOptPass());
MPM.addPass(GlobalDCEPass());

// Run partial inlining pass to partially inline functions that have
// large bodies.
Expand Down
1 change: 1 addition & 0 deletions test/Other/new-pm-defaults.ll
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
; CHECK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
; CHECK-O-NEXT: Starting llvm::Module pass manager run.
; CHECK-O-NEXT: Running pass: GlobalOptPass
; CHECK-O-NEXT: Running pass: GlobalDCEPass
; CHECK-O-NEXT: Running pass: EliminateAvailableExternallyPass
; CHECK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
Expand Down
1 change: 1 addition & 0 deletions test/Other/new-pm-thinlto-defaults.ll
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
; CHECK-POSTLINK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
; CHECK-POSTLINK-O-NEXT: Starting llvm::Module pass manager run.
; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
Expand Down

0 comments on commit 6bfe1d9

Please sign in to comment.