[PATCH] D19773: Tweak the ThinLTO pass pipeline

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 09:08:19 PDT 2016


joker.eph added inline comments.

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:428
@@ -432,1 +427,3 @@
 
+  if (PerformThinLTO)
+    // Optimize globals now when performing ThinLTO, this enables more
----------------
tejohnson wrote:
> Is there any significance to the move of the globalopt invocation here from its original location below LoopVersioningLICM?
I didn't really design the original position to be after LICM. I wrote this back in October before  `ReversePostOrderFunctionAttrr` and `LoopVersioningLICM` exist.
I inserted it originally right after `EliminateAvailableExternally`.
In the meantime `LoopVersioningLICM` was inserted before `EliminateAvailableExternally`. In this patch I reorganized `ReversePostOrderFunctionAttrr`, `EliminateAvailableExternally`, and `GlobalOpt` to be ran before `LICM` (which is more part of the function optimization pipeline that follow) last week in this patch. 
Then I was asked to split the patch, so what remains is only this part of the move.


================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:448
@@ -447,3 @@
-    MPM.add(createGlobalOptimizerPass());
-    // Remove dead fns and globals after globalopt.
-    MPM.add(createGlobalDCEPass());
----------------
tejohnson wrote:
> Why are the globalDCE before and after globalopt no longer needed (for the reasons stated in the comments)?
I think my original comments were buggy: `GlobalOptimizer` performs DCE as well.


http://reviews.llvm.org/D19773





More information about the llvm-commits mailing list