aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorJan Voung <jvoung@gmail.com>2024-04-30 09:26:09 -0400
committerGitHub <noreply@github.com>2024-04-30 06:26:09 -0700
commitadabdc12f995b0af74c866201899e738796d0d5e (patch)
tree3853c1eee1bd47fe14a942d9d83101391752f2df /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parente50a857fb16bcfe7cfc99bf87db620bc82d1cff5 (diff)
downloadllvm-adabdc12f995b0af74c866201899e738796d0d5e.zip
llvm-adabdc12f995b0af74c866201899e738796d0d5e.tar.gz
llvm-adabdc12f995b0af74c866201899e738796d0d5e.tar.bz2
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 <jvoung@google.com>
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp9
1 files changed, 7 insertions, 2 deletions
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;