[llvm] r335385 - Re-land "[LTO] Enable module summary emission by default for regular LTO"
Tobias Edler von Koch via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 22 13:23:21 PDT 2018
Author: tobiasvk
Date: Fri Jun 22 13:23:21 2018
New Revision: 335385
URL: http://llvm.org/viewvc/llvm-project?rev=335385&view=rev
Log:
Re-land "[LTO] Enable module summary emission by default for regular LTO"
Since we are now producing a summary also for regular LTO builds, we
need to run the NameAnonGlobals pass in those cases as well (the
summary cannot handle anonymous globals).
See https://reviews.llvm.org/D34156 for details on the original change.
This reverts commit 6c9ee4a4a438a8059aacc809b2dd57128fccd6b3.
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=335385&r1=335384&r2=335385&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Jun 22 13:23:21 2018
@@ -451,7 +451,7 @@ void PassManagerBuilder::populateModuleP
// This has to be done after we add the extensions to the pass manager
// as there could be passes (e.g. Adddress sanitizer) which introduce
// new unnamed globals.
- if (PrepareForThinLTO)
+ if (PrepareForLTO || PrepareForThinLTO)
MPM.add(createNameAnonGlobalPass());
return;
}
@@ -715,6 +715,10 @@ void PassManagerBuilder::populateModuleP
MPM.add(createCFGSimplificationPass());
addExtensionsToPM(EP_OptimizerLast, MPM);
+
+ // Rename anon globals to be able to handle them in the summary
+ if (PrepareForLTO)
+ MPM.add(createNameAnonGlobalPass());
}
void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
More information about the llvm-commits
mailing list