From adabdc12f995b0af74c866201899e738796d0d5e Mon Sep 17 00:00:00 2001 From: Jan Voung Date: Tue, 30 Apr 2024 09:26:09 -0400 Subject: Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries (#90497) GUID often have content in the higher bits of a 64-bit entry so using the unabbrev encoding is inefficient (lots of VBR control bits). Instead, use an abbrev with two 32-bit fixed width chunks. The abbrev also helps encode the "count" in one place instead of in every record. Reduces size of distributed backend summary files by 8.7% in one example app. Co-authored-by: Jan Voung --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 0b7fcd8..a0779f9 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -7513,9 +7513,14 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) { TheIndex.setFlags(Record[0]); break; } - case bitc::FS_VALUE_GUID: { // [valueid, refguid] + case bitc::FS_VALUE_GUID: { // [valueid, refguid_upper32, refguid_lower32] uint64_t ValueID = Record[0]; - GlobalValue::GUID RefGUID = Record[1]; + GlobalValue::GUID RefGUID; + if (Version >= 10) { + RefGUID = Record[1] << 32 | Record[2]; + } else { + RefGUID = Record[1]; + } ValueIdToValueInfoMap[ValueID] = std::make_tuple( TheIndex.getOrInsertValueInfo(RefGUID), RefGUID, RefGUID); break; -- cgit v1.1