diff options
author | Matthew Voss <matthew.voss@sony.com> | 2023-07-05 14:17:20 -0700 |
---|---|---|
committer | Matthew Voss <matthew.voss@sony.com> | 2023-07-05 14:53:14 -0700 |
commit | a1ca3af31eeec61cfb9d619f55b655b0eb0b9494 (patch) | |
tree | f7127bd5940108b5fec1690ab872425afcb244a2 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 156913cb776438f87bd1580de862eac7be79ca2a (diff) | |
download | llvm-a1ca3af31eeec61cfb9d619f55b655b0eb0b9494.zip llvm-a1ca3af31eeec61cfb9d619f55b655b0eb0b9494.tar.gz llvm-a1ca3af31eeec61cfb9d619f55b655b0eb0b9494.tar.bz2 |
[llvm] A Unified LTO Bitcode Frontend
Here's a high level summary of the changes in this patch. For more
information on rational, see the RFC.
(https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774).
- Add config parameter to LTO backend, specifying which LTO mode is
desired when using unified LTO.
- Add unified LTO flag to the summary index for efficiency. Unified
LTO modules can be detected without parsing the module.
- Make sure that the ModuleID is generated by incorporating more types
of symbols.
Differential Revision: https://reviews.llvm.org/D123803
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index fd125ac..165b8f1 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -786,10 +786,14 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( std::function<const StackSafetyInfo *(const Function &F)> GetSSICallback) { assert(PSI); bool EnableSplitLTOUnit = false; + bool UnifiedLTO = false; if (auto *MD = mdconst::extract_or_null<ConstantInt>( M.getModuleFlag("EnableSplitLTOUnit"))) EnableSplitLTOUnit = MD->getZExtValue(); - ModuleSummaryIndex Index(/*HaveGVs=*/true, EnableSplitLTOUnit); + if (auto *MD = + mdconst::extract_or_null<ConstantInt>(M.getModuleFlag("UnifiedLTO"))) + UnifiedLTO = MD->getZExtValue(); + ModuleSummaryIndex Index(/*HaveGVs=*/true, EnableSplitLTOUnit, UnifiedLTO); // Identify the local values in the llvm.used and llvm.compiler.used sets, // which should not be exported as they would then require renaming and |