summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index cf1d3f26dc8..7867bf44a52 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -249,8 +249,6 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
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::populateModulePassManager(
// 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
OpenPOWER on IntegriCloud