[PATCH] D38154: [PassManager] Run global opts after the inliner

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 14:26:47 PDT 2017


davide created this revision.
Herald added a subscriber: mehdi_amini.

https://reviews.llvm.org/D38154

Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp


Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -502,6 +502,15 @@
   if (Inliner) {
     MPM.add(Inliner);
     Inliner = nullptr;
+
+    // The inliner performs some kind of dead code elimination as it goes,
+    // but there are cases that are not really caught by it. We might
+    // at some point consider teaching the inliner about them, but it
+    // is OK for now to run GlobalOpt + GlobalDCE in tandem as their
+    // benefits generally outweight the cost, making the whole pipeline
+    // faster. See PR34652.
+    PM.add(createGlobalOptimizerPass());
+    PM.add(createGlobalDCEPass());
   }
   if (!DisableUnitAtATime)
     MPM.add(createPostOrderFunctionAttrsLegacyPass());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38154.116266.patch
Type: text/x-patch
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170921/2acccf76/attachment.bin>


More information about the llvm-commits mailing list