llvm.org GIT mirror llvm / 8777897
[ThinLTO] Use valueid instead of bitcode offsets in combined index file Summary: With the removal of support for lazy parsing of combined index summary records (e.g. r267344), we no longer need to include the summary record bitcode offset in the VST entries for definitions. Change the combined index format to be similar to the per-module index format in using value ids to cross-reference from the summary record to the VST entry (rather than the summary record bitcode offset to cross-reference in the other direction). The visible changes are: 1) Add the value id to the combined summary records 2) Remove the summary offset from the combined VST records, which has the following effects: - No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all combined index VST entries now only contain the value id and corresponding GUID. - No longer have duplicate VST entries in the case where there are multiple definitions of a symbol (e.g. weak/linkonce), as they all have the same value id and GUID. An implication of #2 above is that in order to hook up an alias to the correct aliasee based on the value id of the aliasee recorded in the combined index alias record, we need to scan the entries in the index for that GUID to find the one from the same module (i.e. the case where there are multiple entries for the aliasee). But the reader no longer has to maintain a special map to hook up the alias/aliasee. Reviewers: joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267712 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 3 years ago
13 changed file(s) with 102 addition(s) and 152 deletion(s). Raw diff Collapse all Expand all
179179 VST_CODE_ENTRY = 1, // VST_ENTRY: [valueid, namechar x N]
180180 VST_CODE_BBENTRY = 2, // VST_BBENTRY: [bbid, namechar x N]
181181 VST_CODE_FNENTRY = 3, // VST_FNENTRY: [valueid, offset, namechar x N]
182 // VST_COMBINED_GVDEFENTRY: [valueid, sumoffset, guid]
183 VST_CODE_COMBINED_GVDEFENTRY = 4,
184182 // VST_COMBINED_ENTRY: [valueid, refguid]
185183 VST_CODE_COMBINED_ENTRY = 5
186184 };
203201 FS_PERMODULE_PROFILE = 2,
204202 // PERMODULE_GLOBALVAR_INIT_REFS: [valueid, flags, n x valueid]
205203 FS_PERMODULE_GLOBALVAR_INIT_REFS = 3,
206 // COMBINED: [modid, flags, instcount, numrefs, numrefs x valueid,
204 // COMBINED: [valueid, modid, flags, instcount, numrefs, numrefs x valueid,
207205 // n x (valueid, callsitecount)]
208206 FS_COMBINED = 4,
209 // COMBINED_PROFILE: [modid, flags, instcount, numrefs,
207 // COMBINED_PROFILE: [valueid, modid, flags, instcount, numrefs,
210208 // numrefs x valueid,
211209 // n x (valueid, callsitecount, profilecount)]
212210 FS_COMBINED_PROFILE = 5,
213 // COMBINED_GLOBALVAR_INIT_REFS: [modid, flags, n x valueid]
211 // COMBINED_GLOBALVAR_INIT_REFS: [valueid, modid, flags, n x valueid]
214212 FS_COMBINED_GLOBALVAR_INIT_REFS = 6,
215213 // ALIAS: [valueid, flags, valueid]
216214 FS_ALIAS = 7,
217 // COMBINED_ALIAS: [modid, flags, offset]
215 // COMBINED_ALIAS: [valueid, modid, flags, valueid]
218216 FS_COMBINED_ALIAS = 8,
219217 // COMBINED_ORIGINAL_NAME: [original_name_hash]
220218 FS_COMBINED_ORIGINAL_NAME = 9,
374374 GlobalValueMap[ValueGUID].push_back(std::move(Summary));
375375 }
376376
377 /// Find the summary for global \p GUID in module \p ModuleId, or nullptr if
378 /// not found.
379 GlobalValueSummary *findSummaryInModule(GlobalValue::GUID ValueGUID,
380 StringRef ModuleId) const {
381 auto CalleeInfoList = findGlobalValueSummaryList(ValueGUID);
382 if (CalleeInfoList == end()) {
383 return nullptr; // This function does not have a summary
384 }
385 auto Summary =
386 llvm::find_if(CalleeInfoList->second,
387 [&](const std::unique_ptr &Summary) {
388 return Summary->modulePath() == ModuleId;
389 });
390 if (Summary == CalleeInfoList->second.end())
391 return nullptr;
392 return Summary->get();
393 }
394
377395 /// Returns the first GlobalValueSummary for \p GV, asserting that there
378396 /// is only one if \p PerModuleIndex.
379397 GlobalValueSummary *getGlobalValueSummary(const GlobalValue &GV,
491491 DenseMap>
492492 ValueIdToCallGraphGUIDMap;
493493
494 /// Map to save the association between summary offset in the VST to the
495 /// GUID created when parsing it. Used to add newly parsed summaries to
496 /// the index.
497 DenseMap SummaryOffsetToGUIDMap;
498
499494 /// Map populated during module path string table parsing, from the
500495 /// module ID to a string reference owned by the index's module
501496 /// path string table, used to correlate with combined index
547542 std::error_code initLazyStream(std::unique_ptr Streamer);
548543 std::pair
549544 getGUIDFromValueId(unsigned ValueId);
550 GlobalValue::GUID getGUIDFromOffset(uint64_t Offset);
551545 };
552546 } // end anonymous namespace
553547
57395733 return VGI->second;
57405734 }
57415735
5742 GlobalValue::GUID
5743 ModuleSummaryIndexBitcodeReader::getGUIDFromOffset(uint64_t Offset) {
5744 auto I = SummaryOffsetToGUIDMap.find(Offset);
5745 assert(I != SummaryOffsetToGUIDMap.end());
5746 return I->second;
5747 }
5748
57495736 // Specialized value symbol table parser used when reading module index
57505737 // blocks where we don't actually create global values. The parsed information
57515738 // is saved in the bitcode reader for use when later parsing summaries.
58295816 std::make_pair(FunctionGUID, OriginalNameID);
58305817
58315818 ValueName.clear();
5832 break;
5833 }
5834 case bitc::VST_CODE_COMBINED_GVDEFENTRY: {
5835 // VST_CODE_COMBINED_GVDEFENTRY: [valueid, offset, guid]
5836 unsigned ValueID = Record[0];
5837 uint64_t GlobalValSummaryOffset = Record[1];
5838 GlobalValue::GUID GlobalValGUID = Record[2];
5839 SummaryOffsetToGUIDMap[GlobalValSummaryOffset] = GlobalValGUID;
5840 // The "original name", which is the second value of the pair will be
5841 // overriden later by a FS_COMBINED_ORIGINAL_NAME in the combined index.
5842 ValueIdToCallGraphGUIDMap[ValueID] =
5843 std::make_pair(GlobalValGUID, GlobalValGUID);
58445819 break;
58455820 }
58465821 case bitc::VST_CODE_COMBINED_ENTRY: {
60296004 // "OriginalName" attachement.
60306005 GlobalValueSummary *LastSeenSummary = nullptr;
60316006 bool Combined = false;
6032 // For aliases in the combined summary, we need to know which summary
6033 // corresponds to the aliasee offset saved in the alias summary. It isn't
6034 // sufficient to just map to the aliasee GUID, since in the combined summary
6035 // there may be multiple values with the same GUID.
6036 DenseMap OffsetToSummaryMap;
60376007 while (1) {
60386008 BitstreamEntry Entry = Stream.advanceSkippingSubblocks();
60396009
60666036 // in the combined index VST entries). The records also contain
60676037 // information used for ThinLTO renaming and importing.
60686038 Record.clear();
6069 uint64_t CurRecordBit = Stream.GetCurrentBitNo();
60706039 auto BitCode = Stream.readRecord(Entry.ID, Record);
60716040 switch (BitCode) {
60726041 default: // Default behavior: ignore.
61636132 TheIndex->addGlobalValueSummary(GUID.first, std::move(FS));
61646133 break;
61656134 }
6166 // FS_COMBINED: [modid, flags, instcount, numrefs, numrefs x valueid,
6167 // n x (valueid, callsitecount)]
6168 // FS_COMBINED_PROFILE: [modid, flags, instcount, numrefs,
6135 // FS_COMBINED: [valueid, modid, flags, instcount, numrefs,
6136 // numrefs x valueid, n x (valueid, callsitecount)]
6137 // FS_COMBINED_PROFILE: [valueid, modid, flags, instcount, numrefs,
61696138 // numrefs x valueid,
61706139 // n x (valueid, callsitecount, profilecount)]
61716140 case bitc::FS_COMBINED:
61726141 case bitc::FS_COMBINED_PROFILE: {
6173 uint64_t ModuleId = Record[0];
6174 uint64_t RawFlags = Record[1];
6175 unsigned InstCount = Record[2];
6176 unsigned NumRefs = Record[3];
6142 unsigned ValueID = Record[0];
6143 uint64_t ModuleId = Record[1];
6144 uint64_t RawFlags = Record[2];
6145 unsigned InstCount = Record[3];
6146 unsigned NumRefs = Record[4];
61776147 auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
61786148 std::unique_ptr FS =
61796149 llvm::make_unique(Flags, InstCount);
61806150 LastSeenSummary = FS.get();
61816151 FS->setModulePath(ModuleIdMap[ModuleId]);
6182 static int RefListStartIndex = 4;
6152 static int RefListStartIndex = 5;
61836153 int CallGraphEdgeStartIndex = RefListStartIndex + NumRefs;
61846154 assert(Record.size() >= RefListStartIndex + NumRefs &&
61856155 "Record size inconsistent with number of references");
6186 for (unsigned I = 4, E = CallGraphEdgeStartIndex; I != E; ++I) {
6156 for (unsigned I = RefListStartIndex, E = CallGraphEdgeStartIndex; I != E;
6157 ++I) {
61876158 unsigned RefValueId = Record[I];
61886159 GlobalValue::GUID RefGUID = getGUIDFromValueId(RefValueId).first;
61896160 FS->addRefEdge(RefGUID);
61986169 FS->addCallGraphEdge(CalleeGUID,
61996170 CalleeInfo(CallsiteCount, ProfileCount));
62006171 }
6201 GlobalValue::GUID GUID = getGUIDFromOffset(CurRecordBit);
6202 OffsetToSummaryMap[CurRecordBit] = FS.get();
6172 GlobalValue::GUID GUID = getGUIDFromValueId(ValueID).first;
62036173 TheIndex->addGlobalValueSummary(GUID, std::move(FS));
62046174 Combined = true;
62056175 break;
62066176 }
6207 // FS_COMBINED_ALIAS: [modid, flags, offset]
6177 // FS_COMBINED_ALIAS: [valueid, modid, flags, valueid]
62086178 // Aliases must be emitted (and parsed) after all FS_COMBINED entries, as
62096179 // they expect all aliasee summaries to be available.
62106180 case bitc::FS_COMBINED_ALIAS: {
6211 uint64_t ModuleId = Record[0];
6212 uint64_t RawFlags = Record[1];
6213 uint64_t AliaseeSummaryOffset = Record[2];
6181 unsigned ValueID = Record[0];
6182 uint64_t ModuleId = Record[1];
6183 uint64_t RawFlags = Record[2];
6184 unsigned AliaseeValueId = Record[3];
62146185 auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
62156186 std::unique_ptr AS = llvm::make_unique(Flags);
62166187 LastSeenSummary = AS.get();
62176188 AS->setModulePath(ModuleIdMap[ModuleId]);
62186189
6219 auto *AliaseeSummary = OffsetToSummaryMap[AliaseeSummaryOffset];
6220 if (!AliaseeSummary)
6190 auto AliaseeGUID = getGUIDFromValueId(AliaseeValueId).first;
6191 auto AliaseeInModule =
6192 TheIndex->findSummaryInModule(AliaseeGUID, AS->modulePath());
6193 if (!AliaseeInModule)
62216194 return error("Alias expects aliasee summary to be parsed");
6222 AS->setAliasee(AliaseeSummary);
6223
6224 GlobalValue::GUID GUID = getGUIDFromOffset(CurRecordBit);
6195 AS->setAliasee(AliaseeInModule);
6196
6197 GlobalValue::GUID GUID = getGUIDFromValueId(ValueID).first;
62256198 TheIndex->addGlobalValueSummary(GUID, std::move(AS));
62266199 Combined = true;
62276200 break;
62286201 }
6229 // FS_COMBINED_GLOBALVAR_INIT_REFS: [modid, flags, n x valueid]
6202 // FS_COMBINED_GLOBALVAR_INIT_REFS: [valueid, modid, flags, n x valueid]
62306203 case bitc::FS_COMBINED_GLOBALVAR_INIT_REFS: {
6231 uint64_t ModuleId = Record[0];
6232 uint64_t RawFlags = Record[1];
6204 unsigned ValueID = Record[0];
6205 uint64_t ModuleId = Record[1];
6206 uint64_t RawFlags = Record[2];
62336207 auto Flags = getDecodedGVSummaryFlags(RawFlags, Version);
62346208 std::unique_ptr FS =
62356209 llvm::make_unique(Flags);
62366210 LastSeenSummary = FS.get();
62376211 FS->setModulePath(ModuleIdMap[ModuleId]);
6238 for (unsigned I = 2, E = Record.size(); I != E; ++I) {
6212 for (unsigned I = 3, E = Record.size(); I != E; ++I) {
62396213 unsigned RefValueId = Record[I];
62406214 GlobalValue::GUID RefGUID = getGUIDFromValueId(RefValueId).first;
62416215 FS->addRefEdge(RefGUID);
62426216 }
6243 GlobalValue::GUID GUID = getGUIDFromOffset(CurRecordBit);
6244 OffsetToSummaryMap[CurRecordBit] = FS.get();
6217 GlobalValue::GUID GUID = getGUIDFromValueId(ValueID).first;
62456218 TheIndex->addGlobalValueSummary(GUID, std::move(FS));
62466219 Combined = true;
62476220 break;
269269 /// Tracks the last value id recorded in the GUIDToValueMap.
270270 unsigned GlobalValueId = 0;
271271
272 /// Record the starting offset of each summary entry for use in the VST
273 /// entry, and for any possible alias.
274 DenseMap SummaryToOffsetMap;
275
276272 public:
277273 /// Constructs a IndexBitcodeWriter object for the given combined index,
278274 /// writing to the provided \p Buffer.
310306 } else {
311307 return VMI->second;
312308 }
313 }
314 unsigned popValueId(GlobalValue::GUID ValGUID) {
315 const auto &VMI = GUIDToValueIdMap.find(ValGUID);
316 assert(VMI != GUIDToValueIdMap.end());
317 unsigned ValueId = VMI->second;
318 GUIDToValueIdMap.erase(VMI);
319 return ValueId;
320309 }
321310 std::map &valueIds() { return GUIDToValueIdMap; }
322311 };
26282617 Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 4);
26292618
26302619 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
2631 Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_COMBINED_GVDEFENTRY));
2632 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
2633 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // sumoffset
2634 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // guid
2635 unsigned DefEntryAbbrev = Stream.EmitAbbrev(Abbv);
2636
2637 Abbv = new BitCodeAbbrev();
26382620 Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_COMBINED_ENTRY));
26392621 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
26402622 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // refguid
26412623 unsigned EntryAbbrev = Stream.EmitAbbrev(Abbv);
26422624
26432625 SmallVector NameVals;
2644
2645 for (const auto &GSI : Index) {
2646 GlobalValue::GUID ValGUID = GSI.first;
2647 unsigned ValueId = popValueId(ValGUID);
2648
2649 for (const auto &SI : GSI.second) {
2650 // VST_CODE_COMBINED_GVDEFENTRY: [valueid, sumoffset, guid]
2651 NameVals.push_back(ValueId);
2652 auto Offset = SummaryToOffsetMap[SI.get()];
2653 assert(Offset);
2654 NameVals.push_back(Offset);
2655 NameVals.push_back(ValGUID);
2656
2657 // Emit the finished record.
2658 Stream.EmitRecord(bitc::VST_CODE_COMBINED_GVDEFENTRY, NameVals,
2659 DefEntryAbbrev);
2660 NameVals.clear();
2661 }
2662 }
26632626 for (const auto &GVI : valueIds()) {
26642627 // VST_CODE_COMBINED_ENTRY: [valueid, refguid]
26652628 NameVals.push_back(GVI.second);
31933156 // Abbrev for FS_COMBINED.
31943157 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
31953158 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED));
3159 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
31963160 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
31973161 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // flags
31983162 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // instcount
32053169 // Abbrev for FS_COMBINED_PROFILE.
32063170 Abbv = new BitCodeAbbrev();
32073171 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_PROFILE));
3172 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
32083173 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
32093174 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // flags
32103175 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // instcount
32173182 // Abbrev for FS_COMBINED_GLOBALVAR_INIT_REFS.
32183183 Abbv = new BitCodeAbbrev();
32193184 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_GLOBALVAR_INIT_REFS));
3185 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
32203186 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
32213187 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // flags
32223188 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); // valueids
32263192 // Abbrev for FS_COMBINED_ALIAS.
32273193 Abbv = new BitCodeAbbrev();
32283194 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_ALIAS));
3195 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
32293196 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
32303197 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // flags
3231 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // offset
3198 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
32323199 unsigned FSAliasAbbrev = Stream.EmitAbbrev(Abbv);
32333200
3234 // The aliases are emitted as a post-pass, and will point to the summary
3235 // offset id of the aliasee. Save them in a vector for post-processing.
3201 // The aliases are emitted as a post-pass, and will point to the value
3202 // id of the aliasee. Save them in a vector for post-processing.
32363203 SmallVector Aliases;
3204
3205 // Save the value id for each summary for alias emission.
3206 DenseMap SummaryToValueIdMap;
32373207
32383208 SmallVector NameVals;
32393209
32513221 for (auto &SI : GSI.second) {
32523222 GlobalValueSummary *S = SI.get();
32533223 assert(S);
3224
3225 assert(hasValueId(GSI.first));
3226 unsigned ValueId = getValueId(GSI.first);
3227 SummaryToValueIdMap[S] = ValueId;
3228
32543229 if (auto *AS = dyn_cast(S)) {
32553230 // Will process aliases as a post-pass because the reader wants all
32563231 // global to be loaded first.
32593234 }
32603235
32613236 if (auto *VS = dyn_cast(S)) {
3237 NameVals.push_back(ValueId);
32623238 NameVals.push_back(Index.getModuleId(VS->modulePath()));
32633239 NameVals.push_back(getEncodedGVSummaryFlags(VS->flags()));
32643240 for (auto &RI : VS->refs()) {
32653241 NameVals.push_back(getValueId(RI.getGUID()));
32663242 }
3267
3268 // Record the starting offset of this summary entry for use in the VST
3269 // entry, and for any possible alias. Add the current code size since
3270 // the reader will invoke readRecord after the abbrev id read.
3271 SummaryToOffsetMap[S] =
3272 Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth();
32733243
32743244 // Emit the finished record.
32753245 Stream.EmitRecord(bitc::FS_COMBINED_GLOBALVAR_INIT_REFS, NameVals,
32803250 }
32813251
32823252 auto *FS = cast(S);
3253 NameVals.push_back(ValueId);
32833254 NameVals.push_back(Index.getModuleId(FS->modulePath()));
32843255 NameVals.push_back(getEncodedGVSummaryFlags(FS->flags()));
32853256 NameVals.push_back(FS->instCount());
33083279 NameVals.push_back(EI.second.ProfileCount);
33093280 }
33103281
3311 // Record the starting offset of this summary entry for use in the VST
3312 // entry, and for any possible alias. Add the current code size since
3313 // the reader will invoke readRecord after the abbrev id read.
3314 SummaryToOffsetMap[S] =
3315 Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth();
3316
33173282 unsigned FSAbbrev =
33183283 (HasProfileData ? FSCallsProfileAbbrev : FSCallsAbbrev);
33193284 unsigned Code =
33273292 }
33283293
33293294 for (auto *AS : Aliases) {
3295 auto AliasValueId = SummaryToValueIdMap[AS];
3296 assert(AliasValueId);
3297 NameVals.push_back(AliasValueId);
33303298 NameVals.push_back(Index.getModuleId(AS->modulePath()));
33313299 NameVals.push_back(getEncodedGVSummaryFlags(AS->flags()));
3332 auto AliaseeOffset = SummaryToOffsetMap[&AS->getAliasee()];
3333 assert(AliaseeOffset);
3334 NameVals.push_back(AliaseeOffset);
3335
3336 // Record the starting offset of this summary entry for use
3337 // in the VST entry. Add the current code size since the
3338 // reader will invoke readRecord after the abbrev id read.
3339 SummaryToOffsetMap[AS] =
3340 Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth();
3300 auto AliaseeValueId = SummaryToValueIdMap[&AS->getAliasee()];
3301 assert(AliaseeValueId);
3302 NameVals.push_back(AliaseeValueId);
33413303
33423304 // Emit the finished record.
33433305 Stream.EmitRecord(bitc::FS_COMBINED_ALIAS, NameVals, FSAliasAbbrev);
2020 ; COMBINED-NEXT:
2121 ; See if the call to analias is registered, using the expected callsite count
2222 ; and value id matching the subsequent value symbol table.
23 ; COMBINED-NEXT: 4=[[ALIASID:[0-9]+]] op5=1/>
23 ; COMBINED-NEXT: 5=[[ALIASID:[0-9]+]] op6=1/>
2424 ; Followed by the alias and aliasee
2525 ; COMBINED-NEXT:
26 ; COMBINED-NEXT: 2=[[ALIASEEOFFSET:[0-9]+]]
26 ; COMBINED-NEXT: 3=[[ALIASEEID:[0-9]+]]
2727 ; COMBINED-NEXT:
2828 ; COMBINED-NEXT:
2929 ; Entry for function func should have entry with value id ALIASID
30 ; COMBINED-NEXT:
31 ; COMBINED-NEXT:
32 ; COMBINED-NEXT: GVDEFENTRY {{.*}} op1=[[ALIASEEOFFSET]] op2=-1039159065113703048/>
30 ; COMBINED-NEXT: ENTRY {{.*}} op0=[[ALIASID]] op1=-5751648690987223394/>
31 ; COMBINED-NEXT:
32 ; COMBINED-NEXT:
3333 ; COMBINED-NEXT:
3434
3535 ; ModuleID = 'thinlto-function-summary-callgraph.ll'
2121 ; COMBINED-NEXT:
2222 ; See if the call to func is registered, using the expected callsite count
2323 ; and profile count, with value id matching the subsequent value symbol table.
24 ; COMBINED-NEXT: 4=[[FUNCID:[0-9]+]] op5=1 op6=1/>
24 ; COMBINED-NEXT: 5=[[FUNCID:[0-9]+]] op6=1 op7=1/>
2525 ; COMBINED-NEXT:
2626 ; COMBINED-NEXT:
2727 ; Entry for function func should have entry with value id FUNCID
28 ; COMBINED-NEXT:
29 ; COMBINED-NEXT: GVDEFENTRY
28 ; COMBINED-NEXT: ENTRY {{.*}} op0=[[FUNCID]] op1=7289175272376759421/>
29 ; COMBINED-NEXT:
3030 ; COMBINED-NEXT:
3131
3232 ; ModuleID = 'thinlto-function-summary-callgraph.ll'
2121 ; COMBINED-NEXT:
2222 ; See if the call to func is registered, using the expected callsite count
2323 ; and value id matching the subsequent value symbol table.
24 ; COMBINED-NEXT: 4=[[FUNCID:[0-9]+]] op5=1/>
24 ; COMBINED-NEXT: 5=[[FUNCID:[0-9]+]] op6=1/>
2525 ; COMBINED-NEXT:
2626 ; COMBINED-NEXT:
2727 ; Entry for function func should have entry with value id FUNCID
28 ; COMBINED-NEXT:
29 ; COMBINED-NEXT: GVDEFENTRY
28 ; COMBINED-NEXT: ENTRY {{.*}} op0=[[FUNCID]] op1=7289175272376759421/>
29 ; COMBINED-NEXT:
3030 ; COMBINED-NEXT:
3131
3232 ; ModuleID = 'thinlto-function-summary-callgraph.ll'
1212 ; COMBINED-DAG:
1313 ; COMBINED-NEXT:
1414 ; COMBINED-NEXT:
15 ; COMBINED-NEXT:
16 ; COMBINED-NEXT:
17 ; COMBINED-NEXT: GVDEFENTRY {{.*}} op2=-4377693495213223786/>
15 ; COMBINED-NEXT: ENTRY {{.*}} op1=4947176790635855146/>
16 ; COMBINED-NEXT:
17 ; COMBINED-NEXT:
1818 ; COMBINED-NEXT:
1919
2020 source_filename = "/path/to/source.c"
55
66 define private void @private()
77 ; CHECK:
8 ; COMBINED-DAG: 1=8
8 ; COMBINED-DAG: 2=8
99 {
1010 ret void
1111 }
1212
1313 define internal void @internal()
1414 ; CHECK:
15 ; COMBINED-DAG: 1=7
15 ; COMBINED-DAG: 2=7
1616 {
1717 ret void
1818 }
1919
2020 define available_externally void @available_externally()
2121 ; CHECK:
22 ; COMBINED-DAG: 1=1
22 ; COMBINED-DAG: 2=1
2323 {
2424 ret void
2525 }
2626
2727 define linkonce void @linkonce()
2828 ; CHECK:
29 ; COMBINED-DAG: 1=2
29 ; COMBINED-DAG: 2=2
3030 {
3131 ret void
3232 }
3333
3434 define weak void @weak()
3535 ; CHECK:
36 ; COMBINED-DAG: 1=4
36 ; COMBINED-DAG: 2=4
3737 {
3838 ret void
3939 }
4040
4141 define linkonce_odr void @linkonce_odr()
4242 ; CHECK:
43 ; COMBINED-DAG: 1=3
43 ; COMBINED-DAG: 2=3
4444 {
4545 ret void
4646 }
4747
4848 define weak_odr void @weak_odr()
4949 ; CHECK:
50 ; COMBINED-DAG: 1=5
50 ; COMBINED-DAG: 2=5
5151 {
5252 ret void
5353 }
5454
5555 define external void @external()
5656 ; CHECK:
57 ; COMBINED-DAG: 1=0
57 ; COMBINED-DAG: 2=0
5858 {
5959 ret void
6060 }
44 ; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED
55
66 ; CHECK:
7 ; COMBINED-DAG: 1=16
7 ; COMBINED-DAG: 2=16
88 define void @functionWithSection() section "some_section" {
99 ret void
1010 }
6464 ; COMBINED-NEXT:
6565 ; Check that the format is: op0=valueid, op1=offset, op2=funcguid,
6666 ; where funcguid is the lower 64 bits of the function name MD5.
67 ; COMBINED-NEXT:
68 ; COMBINED-NEXT: GVDEFENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{[0-9]+}} op2={{-3706093650706652785|-5300342847281564238}}
67 ; COMBINED-NEXT: ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
68 ; COMBINED-NEXT:
6969 ; COMBINED-NEXT:
7070
7171 declare void @g(...)
1616 ; COMBINED-NEXT:
1717 ; Check that the format is: op0=valueid, op1=offset, op2=funcguid,
1818 ; where funcguid is the lower 64 bits of the function name MD5.
19 ; COMBINED-NEXT:
20 ; COMBINED-NEXT: GVDEFENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{[0-9]+}} op2={{-3706093650706652785|-5300342847281564238}}
19 ; COMBINED-NEXT: ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
20 ; COMBINED-NEXT:
2121 ; COMBINED-NEXT:
2222
2323 define void @f() {
287287 STRINGIFY_CODE(VST_CODE, ENTRY)
288288 STRINGIFY_CODE(VST_CODE, BBENTRY)
289289 STRINGIFY_CODE(VST_CODE, FNENTRY)
290 STRINGIFY_CODE(VST_CODE, COMBINED_GVDEFENTRY)
291290 STRINGIFY_CODE(VST_CODE, COMBINED_ENTRY)
292291 }
293292 case bitc::MODULE_STRTAB_BLOCK_ID: