@@ -4299,9 +4299,20 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
4299
4299
return ;
4300
4300
}
4301
4301
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
+
4302
4310
for (const auto &GVI : valueIds ()) {
4303
4311
Stream.EmitRecord (bitc::FS_VALUE_GUID,
4304
- ArrayRef<uint64_t >{GVI.second , GVI.first });
4312
+ ArrayRef<uint32_t >{GVI.second ,
4313
+ static_cast <uint32_t >(GVI.first >> 32 ),
4314
+ static_cast <uint32_t >(GVI.first )},
4315
+ ValueGuidAbbrev);
4305
4316
}
4306
4317
4307
4318
if (!Index->stackIds ().empty ()) {
@@ -4315,7 +4326,7 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
4315
4326
}
4316
4327
4317
4328
// Abbrev for FS_PERMODULE_PROFILE.
4318
- auto Abbv = std::make_shared<BitCodeAbbrev>();
4329
+ Abbv = std::make_shared<BitCodeAbbrev>();
4319
4330
Abbv->Add (BitCodeAbbrevOp (bitc::FS_PERMODULE_PROFILE));
4320
4331
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 )); // valueid
4321
4332
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 )); // flags
@@ -4467,9 +4478,20 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4467
4478
// Write the index flags.
4468
4479
Stream.EmitRecord (bitc::FS_FLAGS, ArrayRef<uint64_t >{Index.getFlags ()});
4469
4480
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
+
4470
4489
for (const auto &GVI : valueIds ()) {
4471
4490
Stream.EmitRecord (bitc::FS_VALUE_GUID,
4472
- ArrayRef<uint64_t >{GVI.second , GVI.first });
4491
+ ArrayRef<uint32_t >{GVI.second ,
4492
+ static_cast <uint32_t >(GVI.first >> 32 ),
4493
+ static_cast <uint32_t >(GVI.first )},
4494
+ ValueGuidAbbrev);
4473
4495
}
4474
4496
4475
4497
if (!StackIdIndices.empty ()) {
@@ -4488,7 +4510,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4488
4510
}
4489
4511
4490
4512
// Abbrev for FS_COMBINED_PROFILE.
4491
- auto Abbv = std::make_shared<BitCodeAbbrev>();
4513
+ Abbv = std::make_shared<BitCodeAbbrev>();
4492
4514
Abbv->Add (BitCodeAbbrevOp (bitc::FS_COMBINED_PROFILE));
4493
4515
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 )); // valueid
4494
4516
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 )); // modid
0 commit comments