diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index 2d1440756a95..15fe342969d6 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -107,11 +107,15 @@ uint64_t ModuleSummaryIndex::getFlags() const { Flags |= 0x40; if (withWholeProgramVisibility()) Flags |= 0x80; + if (withSupportsHotColdNew()) + Flags |= 0x100; + if (hasUnifiedLTO()) + Flags |= 0x200; return Flags; } void ModuleSummaryIndex::setFlags(uint64_t Flags) { - assert(Flags <= 0xff && "Unexpected bits in flag"); + assert(Flags <= 0x2ff && "Unexpected bits in flag"); // 1 bit: WithGlobalValueDeadStripping flag. // Set on combined index only. if (Flags & 0x1) @@ -145,6 +149,14 @@ void ModuleSummaryIndex::setFlags(uint64_t Flags) { // Set on combined index only. if (Flags & 0x80) setWithWholeProgramVisibility(); + // 1 bit: WithSupportsHotColdNew flag. + // Set on combined index only. + if (Flags & 0x100) + setWithSupportsHotColdNew(); + // 1 bit: WithUnifiedLTO flag. + // Set on combined index only. + if (Flags & 0x200) + setUnifiedLTO(); } // Collect for the given module the list of function it defines @@ -317,7 +329,7 @@ void ModuleSummaryIndex::propagateAttributes( } } -bool ModuleSummaryIndex::canImportGlobalVar(GlobalValueSummary *S, +bool ModuleSummaryIndex::canImportGlobalVar(const GlobalValueSummary *S, bool AnalyzeRefs) const { auto HasRefsPreventingImport = [this](const GlobalVarSummary *GVS) { // We don't analyze GV references during attribute propagation, so |