aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorJan Voung <jvoung@gmail.com>2024-05-06 09:37:07 -0400
committerGitHub <noreply@github.com>2024-05-06 21:37:07 +0800
commitd71771dd2748057532603813139d8fd61e83ea79 (patch)
tree8413613c78fe6515b22abf95a8e20d9ef21bdd58 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentecfb5d9951554d8bdb6a499c958f48cc35f78a88 (diff)
downloadllvm-d71771dd2748057532603813139d8fd61e83ea79.zip
llvm-d71771dd2748057532603813139d8fd61e83ea79.tar.gz
llvm-d71771dd2748057532603813139d8fd61e83ea79.tar.bz2
Revert "Reapply "Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries" (#90610)" (#91194)
Reverts llvm/llvm-project#90692 Breaking PPC buildbots. The bots are not meant to test LLD, but are running a test that is using an old version of LLD without the change (so is incompatible). Revert until a fix is found.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 1aaf160..6d01e3b 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -4299,20 +4299,9 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
return;
}
- auto Abbv = std::make_shared<BitCodeAbbrev>();
- Abbv->Add(BitCodeAbbrevOp(bitc::FS_VALUE_GUID));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
- // GUIDS often use up most of 64-bits, so encode as two Fixed 32.
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
- unsigned ValueGuidAbbrev = Stream.EmitAbbrev(std::move(Abbv));
-
for (const auto &GVI : valueIds()) {
Stream.EmitRecord(bitc::FS_VALUE_GUID,
- ArrayRef<uint32_t>{GVI.second,
- static_cast<uint32_t>(GVI.first >> 32),
- static_cast<uint32_t>(GVI.first)},
- ValueGuidAbbrev);
+ ArrayRef<uint64_t>{GVI.second, GVI.first});
}
if (!Index->stackIds().empty()) {
@@ -4326,7 +4315,7 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
}
// Abbrev for FS_PERMODULE_PROFILE.
- Abbv = std::make_shared<BitCodeAbbrev>();
+ auto Abbv = std::make_shared<BitCodeAbbrev>();
Abbv->Add(BitCodeAbbrevOp(bitc::FS_PERMODULE_PROFILE));
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // flags
@@ -4478,20 +4467,9 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
// Write the index flags.
Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Index.getFlags()});
- auto Abbv = std::make_shared<BitCodeAbbrev>();
- Abbv->Add(BitCodeAbbrevOp(bitc::FS_VALUE_GUID));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
- // GUIDS often use up most of 64-bits, so encode as two Fixed 32.
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
- unsigned ValueGuidAbbrev = Stream.EmitAbbrev(std::move(Abbv));
-
for (const auto &GVI : valueIds()) {
Stream.EmitRecord(bitc::FS_VALUE_GUID,
- ArrayRef<uint32_t>{GVI.second,
- static_cast<uint32_t>(GVI.first >> 32),
- static_cast<uint32_t>(GVI.first)},
- ValueGuidAbbrev);
+ ArrayRef<uint64_t>{GVI.second, GVI.first});
}
if (!StackIdIndices.empty()) {
@@ -4510,7 +4488,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
}
// Abbrev for FS_COMBINED_PROFILE.
- Abbv = std::make_shared<BitCodeAbbrev>();
+ auto Abbv = std::make_shared<BitCodeAbbrev>();
Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_PROFILE));
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid