[llvm] r267384 - ThinLTO: Move createNameAnonFunctionPass insertion in PassManagerBuilder (NFC)

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


Author: mehdi_amini
Date: Mon Apr 25 03:47:37 2016
New Revision: 267384

URL: http://llvm.org/viewvc/llvm-project?rev=267384&view=rev
Log:
ThinLTO: Move createNameAnonFunctionPass insertion in PassManagerBuilder (NFC)

It is just code motion, but makes more sense this way.

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=267384&r1=267383&r2=267384&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Mon Apr 25 03:47:37 2016
@@ -249,8 +249,6 @@ void PassManagerBuilder::addFunctionSimp
   if (PrepareForThinLTO) {
     MPM.add(createAggressiveDCEPass());        // Delete dead instructions
     addInstructionCombiningPass(MPM);          // Combine silly seq's
-    // Rename anon function to export them
-    MPM.add(createNameAnonFunctionPass());
     return;
   }
   // Rotate Loop - disable header duplication at -Oz
@@ -405,8 +403,11 @@ void PassManagerBuilder::populateModuleP
   // If we are planning to perform ThinLTO later, let's not bloat the code with
   // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
   // during ThinLTO and perform the rest of the optimizations afterward.
-  if (PrepareForThinLTO)
+  if (PrepareForThinLTO) {
+    // Rename anon function to be able to export them in the summary.
+    MPM.add(createNameAnonFunctionPass());
     return;
+  }
 
   // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
   // pass manager that we are specifically trying to avoid. To prevent this




More information about the llvm-commits mailing list