@@ -424,11 +424,6 @@ class IndexBitcodeWriter : public BitcodeWriterBase {
424
424
// / The combined index to write to bitcode.
425
425
const ModuleSummaryIndex &Index;
426
426
427
- // / When writing combined summaries, provides the set of global value
428
- // / summaries for which the value (function, function alias, etc) should be
429
- // / imported as a declaration.
430
- const GVSummaryPtrSet *DecSummaries = nullptr ;
431
-
432
427
// / When writing a subset of the index for distributed backends, client
433
428
// / provides a map of modules to the corresponding GUIDs/summaries to write.
434
429
const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex;
@@ -457,16 +452,11 @@ class IndexBitcodeWriter : public BitcodeWriterBase {
457
452
// / Constructs a IndexBitcodeWriter object for the given combined index,
458
453
// / writing to the provided \p Buffer. When writing a subset of the index
459
454
// / for a distributed backend, provide a \p ModuleToSummariesForIndex map.
460
- // / If provided, \p ModuleToDecSummaries specifies the set of summaries for
461
- // / which the corresponding functions or aliased functions should be imported
462
- // / as a declaration (but not definition) for each module.
463
455
IndexBitcodeWriter (BitstreamWriter &Stream, StringTableBuilder &StrtabBuilder,
464
456
const ModuleSummaryIndex &Index,
465
- const GVSummaryPtrSet *DecSummaries = nullptr ,
466
457
const std::map<std::string, GVSummaryMapTy>
467
458
*ModuleToSummariesForIndex = nullptr )
468
459
: BitcodeWriterBase(Stream, StrtabBuilder), Index(Index),
469
- DecSummaries (DecSummaries),
470
460
ModuleToSummariesForIndex (ModuleToSummariesForIndex) {
471
461
472
462
// See if the StackIdIndex was already added to the StackId map and
@@ -1221,8 +1211,7 @@ static uint64_t getEncodedFFlags(FunctionSummary::FFlags Flags) {
1221
1211
1222
1212
// Decode the flags for GlobalValue in the summary. See getDecodedGVSummaryFlags
1223
1213
// in BitcodeReader.cpp.
1224
- static uint64_t getEncodedGVSummaryFlags (GlobalValueSummary::GVFlags Flags,
1225
- bool ImportAsDecl = false ) {
1214
+ static uint64_t getEncodedGVSummaryFlags (GlobalValueSummary::GVFlags Flags) {
1226
1215
uint64_t RawFlags = 0 ;
1227
1216
1228
1217
RawFlags |= Flags.NotEligibleToImport ; // bool
@@ -1237,8 +1226,7 @@ static uint64_t getEncodedGVSummaryFlags(GlobalValueSummary::GVFlags Flags,
1237
1226
1238
1227
RawFlags |= (Flags.Visibility << 8 ); // 2 bits
1239
1228
1240
- unsigned ImportType = Flags.ImportType | ImportAsDecl;
1241
- RawFlags |= (ImportType << 10 ); // 1 bit
1229
+ RawFlags |= (Flags.ImportType << 10 ); // 1 bit
1242
1230
1243
1231
return RawFlags;
1244
1232
}
@@ -4585,12 +4573,6 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4585
4573
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 ));
4586
4574
unsigned AllocAbbrev = Stream.EmitAbbrev (std::move (Abbv));
4587
4575
4588
- auto shouldImportValueAsDecl = [&](GlobalValueSummary *GVS) -> bool {
4589
- if (DecSummaries == nullptr )
4590
- return false ;
4591
- return DecSummaries->contains (GVS);
4592
- };
4593
-
4594
4576
// The aliases are emitted as a post-pass, and will point to the value
4595
4577
// id of the aliasee. Save them in a vector for post-processing.
4596
4578
SmallVector<AliasSummary *, 64 > Aliases;
@@ -4701,8 +4683,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4701
4683
NameVals.push_back (*ValueId);
4702
4684
assert (ModuleIdMap.count (FS->modulePath ()));
4703
4685
NameVals.push_back (ModuleIdMap[FS->modulePath ()]);
4704
- NameVals.push_back (
4705
- getEncodedGVSummaryFlags (FS->flags (), shouldImportValueAsDecl (FS)));
4686
+ NameVals.push_back (getEncodedGVSummaryFlags (FS->flags ()));
4706
4687
NameVals.push_back (FS->instCount ());
4707
4688
NameVals.push_back (getEncodedFFlags (FS->fflags ()));
4708
4689
NameVals.push_back (FS->entryCount ());
@@ -4751,8 +4732,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4751
4732
NameVals.push_back (AliasValueId);
4752
4733
assert (ModuleIdMap.count (AS->modulePath ()));
4753
4734
NameVals.push_back (ModuleIdMap[AS->modulePath ()]);
4754
- NameVals.push_back (
4755
- getEncodedGVSummaryFlags (AS->flags (), shouldImportValueAsDecl (AS)));
4735
+ NameVals.push_back (getEncodedGVSummaryFlags (AS->flags ()));
4756
4736
auto AliaseeValueId = SummaryToValueIdMap[&AS->getAliasee ()];
4757
4737
assert (AliaseeValueId);
4758
4738
NameVals.push_back (AliaseeValueId);
@@ -5093,9 +5073,8 @@ void BitcodeWriter::writeModule(const Module &M,
5093
5073
5094
5074
void BitcodeWriter::writeIndex (
5095
5075
const ModuleSummaryIndex *Index,
5096
- const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex,
5097
- const GVSummaryPtrSet *DecSummaries) {
5098
- IndexBitcodeWriter IndexWriter (*Stream, StrtabBuilder, *Index, DecSummaries,
5076
+ const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
5077
+ IndexBitcodeWriter IndexWriter (*Stream, StrtabBuilder, *Index,
5099
5078
ModuleToSummariesForIndex);
5100
5079
IndexWriter.write ();
5101
5080
}
@@ -5150,13 +5129,12 @@ void IndexBitcodeWriter::write() {
5150
5129
// index for a distributed backend, provide a \p ModuleToSummariesForIndex map.
5151
5130
void llvm::writeIndexToFile (
5152
5131
const ModuleSummaryIndex &Index, raw_ostream &Out,
5153
- const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex,
5154
- const GVSummaryPtrSet *DecSummaries) {
5132
+ const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
5155
5133
SmallVector<char , 0 > Buffer;
5156
5134
Buffer.reserve (256 * 1024 );
5157
5135
5158
5136
BitcodeWriter Writer (Buffer);
5159
- Writer.writeIndex (&Index, ModuleToSummariesForIndex, DecSummaries );
5137
+ Writer.writeIndex (&Index, ModuleToSummariesForIndex);
5160
5138
Writer.writeStrtab ();
5161
5139
5162
5140
Out.write ((char *)&Buffer.front (), Buffer.size ());
0 commit comments