aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2025-06-03 16:05:16 -0700
committerGitHub <noreply@github.com>2025-06-03 16:05:16 -0700
commit6c1091ea3fb7ab31aa9b8406cb32b9a549c4e7cd (patch)
tree94319fc6a056dab345d0c3042f5f08c38e82179c /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent33fae0840562ae7e93dd7b4bc6dd4a41150eee01 (diff)
downloadllvm-6c1091ea3fb7ab31aa9b8406cb32b9a549c4e7cd.zip
llvm-6c1091ea3fb7ab31aa9b8406cb32b9a549c4e7cd.tar.gz
llvm-6c1091ea3fb7ab31aa9b8406cb32b9a549c4e7cd.tar.bz2
Revert "[MemProf] Optionally save context size info on largest cold allocations" (#142688)
Reverts llvm/llvm-project#142507 due to buildbot failures that I will look into tomorrow.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index fad8ebf..8789b31 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -23,7 +23,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Analysis/MemoryProfileInfo.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Bitcode/BitcodeCommon.h"
#include "llvm/Bitcode/BitcodeReader.h"
@@ -4586,23 +4585,14 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
Stream.EmitRecord(bitc::FS_STACK_IDS, Vals, StackIdAbbvId);
}
- unsigned ContextIdAbbvId = 0;
- if (metadataMayIncludeContextSizeInfo()) {
- // n x context id
- auto ContextIdAbbv = std::make_shared<BitCodeAbbrev>();
- ContextIdAbbv->Add(BitCodeAbbrevOp(bitc::FS_ALLOC_CONTEXT_IDS));
- ContextIdAbbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
- // The context ids are hashes that are close to 64 bits in size, so emitting
- // as a pair of 32-bit fixed-width values is more efficient than a VBR if we
- // are emitting them for all MIBs. Otherwise we use VBR to better compress 0
- // values that are expected to more frequently occur in an alloc's memprof
- // summary.
- if (metadataIncludesAllContextSizeInfo())
- ContextIdAbbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
- else
- ContextIdAbbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
- ContextIdAbbvId = Stream.EmitAbbrev(std::move(ContextIdAbbv));
- }
+ // n x context id
+ auto ContextIdAbbv = std::make_shared<BitCodeAbbrev>();
+ ContextIdAbbv->Add(BitCodeAbbrevOp(bitc::FS_ALLOC_CONTEXT_IDS));
+ ContextIdAbbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ // The context ids are hashes that are close to 64 bits in size, so emitting
+ // as a pair of 32-bit fixed-width values is more efficient than a VBR.
+ ContextIdAbbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
+ unsigned ContextIdAbbvId = Stream.EmitAbbrev(std::move(ContextIdAbbv));
// Abbrev for FS_PERMODULE_PROFILE.
Abbv = std::make_shared<BitCodeAbbrev>();