]> granicus.if.org Git - llvm/commitdiff
[NewPassManager] Run global dead code elimination after the inliner.
authorDavide Italiano <davide@freebsd.org>
Thu, 5 Oct 2017 18:36:01 +0000 (18:36 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 5 Oct 2017 18:36:01 +0000 (18:36 +0000)
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

lib/Passes/PassBuilder.cpp
test/Other/new-pm-defaults.ll
test/Other/new-pm-thinlto-defaults.ll

index c9cc0c5ae3811509d6f9087ed504b08aea28a51d..9bf5dbd8e652a045cdaae88fcab39a732ed80c07 100644 (file)
@@ -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.
index e9e33ff64241d2ea37b777372ba3ea3264092209..6e5c679e3d93b67ef7dffbdebf5159d9a7fc1fc1 100644 (file)
 ; 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
index f98c393f7988eb4c9a438fd47a388e2332a30035..47074adbcb219d75b8431373dc1411527c35a7a3 100644 (file)
 ; 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