[PATCH] D11919: Enable EliminateAvailableExternally pass in the LTO pipeline.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 14:30:40 PDT 2015


tejohnson created this revision.
tejohnson added reviewers: rnk, dexonsmith.
tejohnson added a subscriber: llvm-commits.

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).

http://reviews.llvm.org/D11919

Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp

Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -556,6 +556,14 @@
   // Delete basic blocks, which optimization passes may have killed.
   PM.add(createCFGSimplificationPass());
 
+  // Remove avail extern fns and globals definitions. Note if they
+  // are unreferenced they will be removed by GlobalDCE below, so
+  // this only impacts referenced available externally globals.
+  // Eventually they will be suppressed during codegen, but eliminating
+  // here enables more opportunity for GlobalDCE as it may make
+  // globals referenced by available external functions dead.
+  PM.add(createEliminateAvailableExternallyPass());
+
   // Now that we have optimized the program, discard unreachable functions.
   PM.add(createGlobalDCEPass());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11919.31727.patch
Type: text/x-patch
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150810/69cc57bf/attachment.bin>


More information about the llvm-commits mailing list