diff options
| author | Tobias Edler von Koch <tobias@codeaurora.org> | 2018-06-22 20:23:21 +0000 |
|---|---|---|
| committer | Tobias Edler von Koch <tobias@codeaurora.org> | 2018-06-22 20:23:21 +0000 |
| commit | 7609cb83e69029a32e8ff94d165ab7315695a356 (patch) | |
| tree | d64a2d82d5c39d85049936c45691bd12b9f1953e /llvm/lib/Transforms | |
| parent | 9bc2c059c3796813995e662d4418e1abfa2f5d73 (diff) | |
| download | bcm5719-llvm-7609cb83e69029a32e8ff94d165ab7315695a356.tar.gz bcm5719-llvm-7609cb83e69029a32e8ff94d165ab7315695a356.zip | |
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.
llvm-svn: 335385
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index a2559bc70b1..750f9c9f10a 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -451,7 +451,7 @@ void PassManagerBuilder::populateModulePassManager( // 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::populateModulePassManager( 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) { |

