[llvm] r267385 - Run GlobalOpt before emitting the bitcode for ThinLTO

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 01:47:49 PDT 2016


Author: mehdi_amini
Date: Mon Apr 25 03:47:49 2016
New Revision: 267385

URL: http://llvm.org/viewvc/llvm-project?rev=267385&view=rev
Log:
Run GlobalOpt before emitting the bitcode for ThinLTO

This is motivated by reducing the size of the IR and thus reduce
compile time.

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp

Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=267385&r1=267384&r2=267385&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Mon Apr 25 03:47:49 2016
@@ -404,6 +404,8 @@ void PassManagerBuilder::populateModuleP
   // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
   // during ThinLTO and perform the rest of the optimizations afterward.
   if (PrepareForThinLTO) {
+    // Reduce the size of the IR as much as possible.
+    MPM.add(createGlobalOptimizerPass());
     // Rename anon function to be able to export them in the summary.
     MPM.add(createNameAnonFunctionPass());
     return;




More information about the llvm-commits mailing list