Skip to content

Commit d71771d

Browse files
authored
Revert "Reapply "Use an abbrev to reduce size of VALUE_GUID records in ThinLTO summaries" (llvm#90610)" (llvm#91194)
Reverts llvm#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.
1 parent ecfb5d9 commit d71771d

22 files changed

+114
-146
lines changed

lld/test/COFF/thinlto-index-only.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
; BACKEND1: <GLOBALVAL_SUMMARY_BLOCK
2323
; BACKEND1: <VERSION
2424
; BACKEND1: <FLAGS
25-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3684000822 op2=3884832250}}
26-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3684000822 op2=3884832250}}
25+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-5300342847281564238|-2624081020897602054}}
26+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-5300342847281564238|-2624081020897602054}}
2727
; BACKEND1: <COMBINED
2828
; BACKEND1: <COMBINED
2929
; BACKEND1: </GLOBALVAL_SUMMARY_BLOCK
@@ -37,7 +37,7 @@
3737
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
3838
; BACKEND2-NEXT: <VERSION
3939
; BACKEND2-NEXT: <FLAGS
40-
; BACKEND2-NEXT: <VALUE_GUID {{.*}} op0=1 op1=3060885059 op2=1207956914
40+
; BACKEND2-NEXT: <VALUE_GUID op0=1 op1=-5300342847281564238
4141
; BACKEND2-NEXT: <COMBINED
4242
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
4343

lld/test/ELF/lto/thinlto-emit-index.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
; BACKEND1: <GLOBALVAL_SUMMARY_BLOCK
7777
; BACKEND1: <VERSION
7878
; BACKEND1: <FLAGS
79-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
80-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
79+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
80+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
8181
; BACKEND1: <COMBINED
8282
; BACKEND1: <COMBINED
8383
; BACKEND1: </GLOBALVAL_SUMMARY_BLOCK
@@ -90,7 +90,7 @@
9090
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
9191
; BACKEND2-NEXT: <VERSION
9292
; BACKEND2-NEXT: <FLAGS
93-
; BACKEND2-NEXT: <VALUE_GUID {{.*}} op0=1 op1=3060885059 op2=1207956914
93+
; BACKEND2-NEXT: <VALUE_GUID op0=1 op1=-5300342847281564238
9494
; BACKEND2-NEXT: <COMBINED
9595
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
9696

lld/test/ELF/lto/thinlto-index-only.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
; BACKEND1: <GLOBALVAL_SUMMARY_BLOCK
104104
; BACKEND1: <VERSION
105105
; BACKEND1: <FLAGS
106-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
107-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
106+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
107+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
108108
; BACKEND1: <COMBINED
109109
; BACKEND1: <COMBINED
110110
; BACKEND1: </GLOBALVAL_SUMMARY_BLOCK
@@ -117,7 +117,7 @@
117117
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
118118
; BACKEND2-NEXT: <VERSION
119119
; BACKEND2-NEXT: <FLAGS
120-
; BACKEND2-NEXT: <VALUE_GUID {{.*}} op0=1 op1=3060885059 op2=1207956914
120+
; BACKEND2-NEXT: <VALUE_GUID op0=1 op1=-5300342847281564238
121121
; BACKEND2-NEXT: <COMBINED
122122
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
123123

lld/test/MachO/thinlto-emit-index.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
; BACKEND1: <GLOBALVAL_SUMMARY_BLOCK
7777
; BACKEND1: <VERSION
7878
; BACKEND1: <FLAGS
79-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
80-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
79+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
80+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
8181
; BACKEND1: <COMBINED
8282
; BACKEND1: <COMBINED
8383
; BACKEND1: </GLOBALVAL_SUMMARY_BLOCK
@@ -90,7 +90,7 @@
9090
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
9191
; BACKEND2-NEXT: <VERSION
9292
; BACKEND2-NEXT: <FLAGS
93-
; BACKEND2-NEXT: <VALUE_GUID {{.*}} op0=1 op1=3060885059 op2=1207956914
93+
; BACKEND2-NEXT: <VALUE_GUID op0=1 op1=-5300342847281564238
9494
; BACKEND2-NEXT: <COMBINED
9595
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
9696

lld/test/MachO/thinlto-index-only.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
; BACKEND1: <GLOBALVAL_SUMMARY_BLOCK
7676
; BACKEND1: <VERSION
7777
; BACKEND1: <FLAGS
78-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
79-
; BACKEND1: <VALUE_GUID {{.*}} op0={{1|2}} {{op1=3060885059 op2=1207956914|op1=3432075125 op2=3712786831}}
78+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
79+
; BACKEND1: <VALUE_GUID op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
8080
; BACKEND1: <COMBINED
8181
; BACKEND1: <COMBINED
8282
; BACKEND1: </GLOBALVAL_SUMMARY_BLOCK
@@ -89,7 +89,7 @@
8989
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
9090
; BACKEND2-NEXT: <VERSION
9191
; BACKEND2-NEXT: <FLAGS
92-
; BACKEND2-NEXT: <VALUE_GUID {{.*}} op0=1 op1=3060885059 op2=1207956914
92+
; BACKEND2-NEXT: <VALUE_GUID op0=1 op1=-5300342847281564238
9393
; BACKEND2-NEXT: <COMBINED
9494
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
9595

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ class ModuleSummaryIndex {
14231423
// in the way some record are interpreted, like flags for instance.
14241424
// Note that incrementing this may require changes in both BitcodeReader.cpp
14251425
// and BitcodeWriter.cpp.
1426-
static constexpr uint64_t BitcodeSummaryVersion = 10;
1426+
static constexpr uint64_t BitcodeSummaryVersion = 9;
14271427

14281428
// Regular LTO module name for ASM writer
14291429
static constexpr const char *getRegularLTOModuleName() {

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7513,14 +7513,9 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
75137513
TheIndex.setFlags(Record[0]);
75147514
break;
75157515
}
7516-
case bitc::FS_VALUE_GUID: { // [valueid, refguid_upper32, refguid_lower32]
7516+
case bitc::FS_VALUE_GUID: { // [valueid, refguid]
75177517
uint64_t ValueID = Record[0];
7518-
GlobalValue::GUID RefGUID;
7519-
if (Version >= 10) {
7520-
RefGUID = Record[1] << 32 | Record[2];
7521-
} else {
7522-
RefGUID = Record[1];
7523-
}
7518+
GlobalValue::GUID RefGUID = Record[1];
75247519
ValueIdToValueInfoMap[ValueID] = std::make_tuple(
75257520
TheIndex.getOrInsertValueInfo(RefGUID), RefGUID, RefGUID);
75267521
break;

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,20 +4299,9 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
42994299
return;
43004300
}
43014301

4302-
auto Abbv = std::make_shared<BitCodeAbbrev>();
4303-
Abbv->Add(BitCodeAbbrevOp(bitc::FS_VALUE_GUID));
4304-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
4305-
// GUIDS often use up most of 64-bits, so encode as two Fixed 32.
4306-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
4307-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
4308-
unsigned ValueGuidAbbrev = Stream.EmitAbbrev(std::move(Abbv));
4309-
43104302
for (const auto &GVI : valueIds()) {
43114303
Stream.EmitRecord(bitc::FS_VALUE_GUID,
4312-
ArrayRef<uint32_t>{GVI.second,
4313-
static_cast<uint32_t>(GVI.first >> 32),
4314-
static_cast<uint32_t>(GVI.first)},
4315-
ValueGuidAbbrev);
4304+
ArrayRef<uint64_t>{GVI.second, GVI.first});
43164305
}
43174306

43184307
if (!Index->stackIds().empty()) {
@@ -4326,7 +4315,7 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
43264315
}
43274316

43284317
// Abbrev for FS_PERMODULE_PROFILE.
4329-
Abbv = std::make_shared<BitCodeAbbrev>();
4318+
auto Abbv = std::make_shared<BitCodeAbbrev>();
43304319
Abbv->Add(BitCodeAbbrevOp(bitc::FS_PERMODULE_PROFILE));
43314320
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
43324321
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // flags
@@ -4478,20 +4467,9 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
44784467
// Write the index flags.
44794468
Stream.EmitRecord(bitc::FS_FLAGS, ArrayRef<uint64_t>{Index.getFlags()});
44804469

4481-
auto Abbv = std::make_shared<BitCodeAbbrev>();
4482-
Abbv->Add(BitCodeAbbrevOp(bitc::FS_VALUE_GUID));
4483-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
4484-
// GUIDS often use up most of 64-bits, so encode as two Fixed 32.
4485-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
4486-
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
4487-
unsigned ValueGuidAbbrev = Stream.EmitAbbrev(std::move(Abbv));
4488-
44894470
for (const auto &GVI : valueIds()) {
44904471
Stream.EmitRecord(bitc::FS_VALUE_GUID,
4491-
ArrayRef<uint32_t>{GVI.second,
4492-
static_cast<uint32_t>(GVI.first >> 32),
4493-
static_cast<uint32_t>(GVI.first)},
4494-
ValueGuidAbbrev);
4472+
ArrayRef<uint64_t>{GVI.second, GVI.first});
44954473
}
44964474

44974475
if (!StackIdIndices.empty()) {
@@ -4510,7 +4488,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
45104488
}
45114489

45124490
// Abbrev for FS_COMBINED_PROFILE.
4513-
Abbv = std::make_shared<BitCodeAbbrev>();
4491+
auto Abbv = std::make_shared<BitCodeAbbrev>();
45144492
Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_PROFILE));
45154493
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
45164494
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid

0 commit comments

Comments
 (0)