diff options
author | Teresa Johnson <tejohnson@google.com> | 2025-05-09 16:28:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 16:28:49 -0700 |
commit | a3d027f92308890c9b1ace7b8a5a7f7d69ce5f0e (patch) | |
tree | 45ba68d909ef66ae61e50d2ce273ad854e995a5b /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 34ecc4b9b8329a833234a84e4cf81c2b7741b4de (diff) | |
download | llvm-a3d027f92308890c9b1ace7b8a5a7f7d69ce5f0e.zip llvm-a3d027f92308890c9b1ace7b8a5a7f7d69ce5f0e.tar.gz llvm-a3d027f92308890c9b1ace7b8a5a7f7d69ce5f0e.tar.bz2 |
[MemProf] Disable alloc context in combined summary for ndebug builds (#139161)
Since we currently only use the context information in the alloc info
summary in the LTO backend for assertion checking, there is no need to
write this into the combined summary index for distributed ThinLTO for
NDEBUG builds. Put this under a new -combined-index-memprof-context
option which is off by default for NDEBUG.
The advantage is that we save time (not having to sort in preparation
for building the radix trees), and space in the generated bitcode files.
We could also do so for the callsite info records, but those are smaller
and less expensive to prepare.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index de7e9bb..a7fbb0c 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -8178,7 +8178,8 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { break; } - case bitc::FS_COMBINED_ALLOC_INFO: { + case bitc::FS_COMBINED_ALLOC_INFO: + case bitc::FS_COMBINED_ALLOC_INFO_NO_CONTEXT: { unsigned I = 0; std::vector<MIBInfo> MIBs; unsigned NumMIBs = Record[I++]; @@ -8187,7 +8188,9 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { while (MIBsRead++ < NumMIBs) { assert(Record.size() - I >= 2); AllocationType AllocType = (AllocationType)Record[I++]; - auto StackIdList = parseAllocInfoContext(Record, I); + SmallVector<unsigned> StackIdList; + if (BitCode == bitc::FS_COMBINED_ALLOC_INFO) + StackIdList = parseAllocInfoContext(Record, I); MIBs.push_back(MIBInfo(AllocType, std::move(StackIdList))); } assert(Record.size() - I >= NumVersions); |