diff options
author | Jan Voung <jvoung@gmail.com> | 2024-04-30 10:09:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-30 07:09:22 -0700 |
commit | 2aabfc811670beb843074c765c056fff4a7b443b (patch) | |
tree | d6d4bfab5778f4b99219234721b8a39ecdc525a0 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | b60a2b931d68b9e119d6e2e6e17126937a646ff9 (diff) | |
download | llvm-2aabfc811670beb843074c765c056fff4a7b443b.zip llvm-2aabfc811670beb843074c765c056fff4a7b443b.tar.gz llvm-2aabfc811670beb843074c765c056fff4a7b443b.tar.bz2 |
Revert "Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries" (#90610)
Reverts llvm/llvm-project#90497
Broke some LLD tests.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 30 |
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 |