@@ -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
}
@@ -4565,12 +4553,6 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4565
4553
Abbv->Add (BitCodeAbbrevOp (BitCodeAbbrevOp::VBR, 8 ));
4566
4554
unsigned AllocAbbrev = Stream.EmitAbbrev (std::move (Abbv));
4567
4555
4568
- auto shouldImportValueAsDecl = [&](GlobalValueSummary *GVS) -> bool {
4569
- if (DecSummaries == nullptr )
4570
- return false ;
4571
- return DecSummaries->contains (GVS);
4572
- };
4573
-
4574
4556
// The aliases are emitted as a post-pass, and will point to the value
4575
4557
// id of the aliasee. Save them in a vector for post-processing.
4576
4558
SmallVector<AliasSummary *, 64 > Aliases;
@@ -4681,8 +4663,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4681
4663
NameVals.push_back (*ValueId);
4682
4664
assert (ModuleIdMap.count (FS->modulePath ()));
4683
4665
NameVals.push_back (ModuleIdMap[FS->modulePath ()]);
4684
- NameVals.push_back (
4685
- getEncodedGVSummaryFlags (FS->flags (), shouldImportValueAsDecl (FS)));
4666
+ NameVals.push_back (getEncodedGVSummaryFlags (FS->flags ()));
4686
4667
NameVals.push_back (FS->instCount ());
4687
4668
NameVals.push_back (getEncodedFFlags (FS->fflags ()));
4688
4669
NameVals.push_back (FS->entryCount ());
@@ -4731,8 +4712,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
4731
4712
NameVals.push_back (AliasValueId);
4732
4713
assert (ModuleIdMap.count (AS->modulePath ()));
4733
4714
NameVals.push_back (ModuleIdMap[AS->modulePath ()]);
4734
- NameVals.push_back (
4735
- getEncodedGVSummaryFlags (AS->flags (), shouldImportValueAsDecl (AS)));
4715
+ NameVals.push_back (getEncodedGVSummaryFlags (AS->flags ()));
4736
4716
auto AliaseeValueId = SummaryToValueIdMap[&AS->getAliasee ()];
4737
4717
assert (AliaseeValueId);
4738
4718
NameVals.push_back (AliaseeValueId);
@@ -5073,9 +5053,8 @@ void BitcodeWriter::writeModule(const Module &M,
5073
5053
5074
5054
void BitcodeWriter::writeIndex (
5075
5055
const ModuleSummaryIndex *Index,
5076
- const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex,
5077
- const GVSummaryPtrSet *DecSummaries) {
5078
- IndexBitcodeWriter IndexWriter (*Stream, StrtabBuilder, *Index, DecSummaries,
5056
+ const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
5057
+ IndexBitcodeWriter IndexWriter (*Stream, StrtabBuilder, *Index,
5079
5058
ModuleToSummariesForIndex);
5080
5059
IndexWriter.write ();
5081
5060
}
@@ -5130,13 +5109,12 @@ void IndexBitcodeWriter::write() {
5130
5109
// index for a distributed backend, provide a \p ModuleToSummariesForIndex map.
5131
5110
void llvm::writeIndexToFile (
5132
5111
const ModuleSummaryIndex &Index, raw_ostream &Out,
5133
- const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex,
5134
- const GVSummaryPtrSet *DecSummaries) {
5112
+ const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
5135
5113
SmallVector<char , 0 > Buffer;
5136
5114
Buffer.reserve (256 * 1024 );
5137
5115
5138
5116
BitcodeWriter Writer (Buffer);
5139
- Writer.writeIndex (&Index, ModuleToSummariesForIndex, DecSummaries );
5117
+ Writer.writeIndex (&Index, ModuleToSummariesForIndex);
5140
5118
Writer.writeStrtab ();
5141
5119
5142
5120
Out.write ((char *)&Buffer.front (), Buffer.size ());
0 commit comments