llvm.org GIT mirror llvm / eb79e6e
ThinLTO: Make aliases explicit in the summary To be able to work accurately on the reference graph when taking decision about internalizing, promoting, renaming, etc. We need to have the alias information explicit. Differential Revision: http://reviews.llvm.org/D18836 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266517 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 4 years ago
11 changed file(s) with 276 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
212212 FS_COMBINED_PROFILE = 5,
213213 // COMBINED_GLOBALVAR_INIT_REFS: [modid, linkage, n x valueid]
214214 FS_COMBINED_GLOBALVAR_INIT_REFS = 6,
215 // ALIAS: [valueid, linkage, valueid]
216 FS_ALIAS = 7,
217 // COMBINED_ALIAS: [modid, linkage, offset]
218 FS_COMBINED_ALIAS = 8,
215219 };
216220
217221 enum MetadataCodes {
9292 class GlobalValueSummary {
9393 public:
9494 /// \brief Sububclass discriminator (for dyn_cast<> et al.)
95 enum SummaryKind { FunctionKind, GlobalVarKind };
95 enum SummaryKind { AliasKind, FunctionKind, GlobalVarKind };
9696
9797 private:
9898 /// Kind of summary for use in dyn_cast<> et al.
161161 /// Return the list of values referenced by this global value definition.
162162 std::vector &refs() { return RefEdgeList; }
163163 const std::vector &refs() const { return RefEdgeList; }
164 };
165
166 /// \brief Alias summary information.
167 class AliasSummary : public GlobalValueSummary {
168 GlobalValueSummary *AliaseeSummary;
169
170 public:
171 /// Summary constructors.
172 AliasSummary(GlobalValue::LinkageTypes Linkage)
173 : GlobalValueSummary(AliasKind, Linkage) {}
174
175 /// Check if this is an alias summary.
176 static bool classof(const GlobalValueSummary *GVS) {
177 return GVS->getSummaryKind() == AliasKind;
178 }
179
180 void setAliasee(GlobalValueSummary *Aliasee) { AliaseeSummary = Aliasee; }
181
182 const GlobalValueSummary &getAliasee() const {
183 return const_cast(this)->getAliasee();
184 }
185
186 GlobalValueSummary &getAliasee() {
187 assert(AliaseeSummary && "Unexpected missing aliasee summary");
188 return *AliaseeSummary;
189 }
164190 };
165191
166192 /// \brief Function summary information to aid decisions and implementation of
438464 /// (GUID -> Summary).
439465 void collectDefinedFunctionsForModule(
440466 StringRef ModulePath,
441 std::mapFunctionSummary *> &FunctionInfoMap) const;
467 std::mapGlobalValueSummary *> &FunctionInfoMap) const;
442468 };
443469
444470 } // End llvm namespace
58645864 Info->setSummary(std::move(FS));
58655865 break;
58665866 }
5867 // FS_ALIAS: [valueid, linkage, valueid]
5868 // Aliases must be emitted (and parsed) after all FS_PERMODULE entries, as
5869 // they expect all aliasee summaries to be available.
5870 case bitc::FS_ALIAS: {
5871 unsigned ValueID = Record[0];
5872 uint64_t RawLinkage = Record[1];
5873 unsigned AliaseeID = Record[2];
5874 std::unique_ptr AS =
5875 llvm::make_unique(getDecodedLinkage(RawLinkage));
5876 // The module path string ref set in the summary must be owned by the
5877 // index's module string table. Since we don't have a module path
5878 // string table section in the per-module index, we create a single
5879 // module path string table entry with an empty (0) ID to take
5880 // ownership.
5881 AS->setModulePath(
5882 TheIndex->addModulePath(Buffer->getBufferIdentifier(), 0)->first());
5883
5884 GlobalValue::GUID AliaseeGUID = getGUIDFromValueId(AliaseeID);
5885 auto *AliaseeInfo = TheIndex->getGlobalValueInfo(AliaseeGUID);
5886 if (!AliaseeInfo->summary())
5887 return error("Alias expects aliasee summary to be parsed");
5888 AS->setAliasee(AliaseeInfo->summary());
5889
5890 GlobalValue::GUID GUID = getGUIDFromValueId(ValueID);
5891 auto *Info = TheIndex->getGlobalValueInfo(GUID);
5892 assert(!Info->summary() && "Expected a single summary per VST entry");
5893 Info->setSummary(std::move(AS));
5894 break;
5895 }
58675896 // FS_PERMODULE_GLOBALVAR_INIT_REFS: [valueid, linkage, n x valueid]
58685897 case bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS: {
58695898 unsigned ValueID = Record[0];
59225951 Combined = true;
59235952 break;
59245953 }
5954 // FS_COMBINED_ALIAS: [modid, linkage, offset]
5955 // Aliases must be emitted (and parsed) after all FS_COMBINED entries, as
5956 // they expect all aliasee summaries to be available.
5957 case bitc::FS_COMBINED_ALIAS: {
5958 uint64_t ModuleId = Record[0];
5959 uint64_t RawLinkage = Record[1];
5960 uint64_t AliaseeSummaryOffset = Record[2];
5961 std::unique_ptr AS =
5962 llvm::make_unique(getDecodedLinkage(RawLinkage));
5963 AS->setModulePath(ModuleIdMap[ModuleId]);
5964
5965 auto *AliaseeInfo = getInfoFromSummaryOffset(AliaseeSummaryOffset);
5966 if (!AliaseeInfo->summary())
5967 return error("Alias expects aliasee summary to be parsed");
5968 AS->setAliasee(AliaseeInfo->summary());
5969
5970 auto *Info = getInfoFromSummaryOffset(CurRecordBit);
5971 assert(!Info->summary() && "Expected a single summary per VST entry");
5972 Info->setSummary(std::move(AS));
5973 Combined = true;
5974 break;
5975 }
59255976 // FS_COMBINED_GLOBALVAR_INIT_REFS: [modid, linkage, n x valueid]
59265977 case bitc::FS_COMBINED_GLOBALVAR_INIT_REFS: {
59275978 uint64_t ModuleId = Record[0];
29242924 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
29252925 unsigned FSModRefsAbbrev = Stream.EmitAbbrev(Abbv);
29262926
2927 // Abbrev for FS_ALIAS.
2928 Abbv = new BitCodeAbbrev();
2929 Abbv->Add(BitCodeAbbrevOp(bitc::FS_ALIAS));
2930 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
2931 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // linkage
2932 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
2933 unsigned FSAliasAbbrev = Stream.EmitAbbrev(Abbv);
2934
29272935 SmallVector NameVals;
29282936 // Iterate over the list of functions instead of the Index to
29292937 // ensure the ordering is stable.
29302938 for (const Function &F : *M) {
29312939 if (F.isDeclaration())
29322940 continue;
2933 // Skip anonymous functions. We will emit a function summary for
2934 // any aliases below.
2941 // Summary emission does not support anonymous functions, they have to
2942 // renamed using the anonymous function renaming pass.
29352943 if (!F.hasName())
2936 continue;
2944 report_fatal_error("Unexpected anonymous function when writing summary");
29372945
29382946 auto *Info = Index.getGlobalValueInfo(F);
29392947 WritePerModuleFunctionSummaryRecord(
29462954 // of a function scope.
29472955 for (const GlobalVariable &G : M->globals())
29482956 WriteModuleLevelReferences(G, Index, VE, NameVals, FSModRefsAbbrev, Stream);
2957
2958 for (const GlobalAlias &A : M->aliases()) {
2959 auto *Aliasee = A.getBaseObject();
2960 if (!Aliasee->hasName())
2961 // Nameless function don't have an entry in the summary, skip it.
2962 continue;
2963 auto AliasId = VE.getValueID(&A);
2964 auto AliaseeId = VE.getValueID(Aliasee);
2965 NameVals.push_back(AliasId);
2966 NameVals.push_back(getEncodedLinkage(A.getLinkage()));
2967 NameVals.push_back(AliaseeId);
2968 Stream.EmitRecord(bitc::FS_ALIAS, NameVals, FSAliasAbbrev);
2969 NameVals.clear();
2970 }
29492971
29502972 Stream.ExitBlock();
29512973 }
29903012 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
29913013 unsigned FSModRefsAbbrev = Stream.EmitAbbrev(Abbv);
29923014
3015 // Abbrev for FS_COMBINED_ALIAS.
3016 Abbv = new BitCodeAbbrev();
3017 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_ALIAS));
3018 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
3019 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // linkage
3020 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // offset
3021 unsigned FSAliasAbbrev = Stream.EmitAbbrev(Abbv);
3022
3023 // The aliases are emitted as a post-pass, and will point to the summary
3024 // offset id of the aliasee. For this purpose we need to be able to get back
3025 // from the summary to the offset
3026 SmallVector Aliases;
3027 DenseMap SummaryToOffsetMap;
3028
29933029 SmallVector NameVals;
29943030 for (const auto &FII : Index) {
29953031 for (auto &FI : FII.second) {
29963032 GlobalValueSummary *S = FI->summary();
29973033 assert(S);
3034 if (isa(S)) {
3035 // Will process aliases as a post-pass because the reader wants all
3036 // global to be loaded first.
3037 Aliases.push_back(FI.get());
3038 continue;
3039 }
29983040
29993041 if (auto *VS = dyn_cast(S)) {
30003042 NameVals.push_back(Index.getModuleId(VS->modulePath()));
30173059 // reader will invoke readRecord after the abbrev id read.
30183060 FI->setBitcodeIndex(Stream.GetCurrentBitNo() +
30193061 Stream.GetAbbrevIDWidth());
3062 // Store temporarily the offset in the map for a possible alias.
3063 SummaryToOffsetMap[S] = FI->bitcodeIndex();
30203064
30213065 // Emit the finished record.
30223066 Stream.EmitRecord(bitc::FS_COMBINED_GLOBALVAR_INIT_REFS, NameVals,
30683112 // in the VST entry. Add the current code size since the
30693113 // reader will invoke readRecord after the abbrev id read.
30703114 FI->setBitcodeIndex(Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth());
3115 // Store temporarily the offset in the map for a possible alias.
3116 SummaryToOffsetMap[S] = FI->bitcodeIndex();
30713117
30723118 unsigned FSAbbrev =
30733119 (HasProfileData ? FSCallsProfileAbbrev : FSCallsAbbrev);
30783124 Stream.EmitRecord(Code, NameVals, FSAbbrev);
30793125 NameVals.clear();
30803126 }
3127 }
3128
3129 for (auto GVI : Aliases) {
3130 AliasSummary *AS = cast(GVI->summary());
3131 NameVals.push_back(Index.getModuleId(AS->modulePath()));
3132 NameVals.push_back(getEncodedLinkage(AS->linkage()));
3133 auto AliaseeOffset = SummaryToOffsetMap[&AS->getAliasee()];
3134 assert(AliaseeOffset);
3135 NameVals.push_back(AliaseeOffset);
3136
3137 // Record the starting offset of this summary entry for use
3138 // in the VST entry. Add the current code size since the
3139 // reader will invoke readRecord after the abbrev id read.
3140 GVI->setBitcodeIndex(Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth());
3141
3142 // Emit the finished record.
3143 Stream.EmitRecord(bitc::FS_COMBINED_ALIAS, NameVals, FSAliasAbbrev);
3144 NameVals.clear();
30813145 }
30823146
30833147 Stream.ExitBlock();
7272 // (GUID -> Summary).
7373 void ModuleSummaryIndex::collectDefinedFunctionsForModule(
7474 StringRef ModulePath,
75 std::mapFunctionSummary *> &FunctionInfoMap) const {
75 std::mapGlobalValueSummary *> &FunctionInfoMap) const {
7676 for (auto &GlobalList : *this) {
7777 auto GUID = GlobalList.first;
7878 for (auto &GlobInfo : GlobalList.second) {
7878 /// number of source modules parsed/linked.
7979 /// - One that has PGO data attached.
8080 /// - [insert you fancy metric here]
81 static const FunctionSummary *
81 static const GlobalValueSummary *
8282 selectCallee(const GlobalValueInfoList &CalleeInfoList, unsigned Threshold) {
8383 auto It = llvm::find_if(
8484 CalleeInfoList, [&](const std::unique_ptr &GlobInfo) {
8585 assert(GlobInfo->summary() &&
8686 "We should not have a Global Info without summary");
87 auto *Summary = cast(GlobInfo->summary());
87 auto *GVSummary = GlobInfo->summary();
88 if (auto *AS = dyn_cast(GVSummary))
89 GVSummary = &AS->getAliasee();
90 auto *Summary = cast(GVSummary);
8891
8992 if (GlobalValue::isWeakAnyLinkage(Summary->linkage()))
9093 return false;
97100 if (It == CalleeInfoList.end())
98101 return nullptr;
99102
100 return cast<FunctionSummary>((*It)->summary());
103 return cast<GlobalValueSummary>((*It)->summary());
101104 }
102105
103106 /// Return the summary for the function \p GUID that fits the \p Threshold, or
104107 /// null if there's no match.
105 static const FunctionSummary *selectCallee(GlobalValue::GUID GUID,
106 unsigned Threshold,
107 const ModuleSummaryIndex &Index) {
108 static const GlobalValueSummary *selectCallee(GlobalValue::GUID GUID,
109 unsigned Threshold,
110 const ModuleSummaryIndex &Index) {
108111 auto CalleeInfoList = Index.findGlobalValueInfoList(GUID);
109112 if (CalleeInfoList == Index.end()) {
110113 return nullptr; // This function does not have a summary
139142 static void computeImportForFunction(
140143 const FunctionSummary &Summary, const ModuleSummaryIndex &Index,
141144 unsigned Threshold,
142 const std::mapFunctionSummary *> &DefinedFunctions,
145 const std::mapGlobalValueSummary *> &DefinedFunctions,
143146 SmallVectorImpl &Worklist,
144147 FunctionImporter::ImportMapTy &ImportsForModule,
145148 StringMap *ExportLists = nullptr) {
157160 DEBUG(dbgs() << "ignored! No qualifying callee with summary found.\n");
158161 continue;
159162 }
160 assert(CalleeSummary->instCount() <= Threshold &&
163 // "Resolve" the summary, traversing alias,
164 const FunctionSummary *ResolvedCalleeSummary;
165 if (isa(CalleeSummary))
166 ResolvedCalleeSummary = cast(
167 &cast(CalleeSummary)->getAliasee());
168 else
169 ResolvedCalleeSummary = cast(CalleeSummary);
170
171 assert(ResolvedCalleeSummary->instCount() <= Threshold &&
161172 "selectCallee() didn't honor the threshold");
162173
163 auto &ProcessedThreshold =
164 ImportsForModule[CalleeSummary->modulePath()][GUID];
174 auto ExportModulePath = ResolvedCalleeSummary->modulePath();
175 auto &ProcessedThreshold = ImportsForModule[ExportModulePath][GUID];
165176 /// Since the traversal of the call graph is DFS, we can revisit a function
166177 /// a second time with a higher threshold. In this case, it is added back to
167178 /// the worklist with the new threshold.
174185 ProcessedThreshold = Threshold;
175186
176187 // Make exports in the source module.
177 auto ExportModulePath = CalleeSummary->modulePath();
178188 if (ExportLists) {
179189 auto &ExportList = (*ExportLists)[ExportModulePath];
180190 ExportList.insert(GUID);
181191 // Mark all functions and globals referenced by this function as exported
182192 // to the outside if they are defined in the same source module.
183 for (auto &Edge : CalleeSummary->calls()) {
193 for (auto &Edge : ResolvedCalleeSummary->calls()) {
184194 auto CalleeGUID = Edge.first.getGUID();
185195 if (isGlobalExported(Index, ExportModulePath, CalleeGUID))
186196 ExportList.insert(CalleeGUID);
187197 }
188 for (auto &Ref : CalleeSummary->refs()) {
198 for (auto &Ref : ResolvedCalleeSummary->refs()) {
189199 auto GUID = Ref.getGUID();
190200 if (isGlobalExported(Index, ExportModulePath, GUID))
191201 ExportList.insert(GUID);
193203 }
194204
195205 // Insert the newly imported function to the worklist.
196 Worklist.push_back(std::make_pair(CalleeSummary, Threshold));
206 Worklist.push_back(std::make_pair(ResolvedCalleeSummary, Threshold));
197207 }
198208 }
199209
201211 /// as well as the list of "exports", i.e. the list of symbols referenced from
202212 /// another module (that may require promotion).
203213 static void ComputeImportForModule(
204 const std::mapFunctionSummary *> &DefinedFunctions,
214 const std::mapGlobalValueSummary *> &DefinedFunctions,
205215 const ModuleSummaryIndex &Index,
206216 FunctionImporter::ImportMapTy &ImportsForModule,
207217 StringMap *ExportLists = nullptr) {
213223 // module
214224 for (auto &FuncInfo : DefinedFunctions) {
215225 auto *Summary = FuncInfo.second;
226 if (auto *AS = dyn_cast(Summary))
227 Summary = &AS->getAliasee();
228 auto *FuncSummary = cast(Summary);
216229 DEBUG(dbgs() << "Initalize import for " << FuncInfo.first << "\n");
217 computeImportForFunction(*Summary, Index, ImportInstrLimit,
230 computeImportForFunction(*FuncSummary, Index, ImportInstrLimit,
218231 DefinedFunctions, Worklist, ImportsForModule,
219232 ExportLists);
220233 }
244257
245258 // Collect for each module the list of function it defines.
246259 // GUID -> Summary
247 StringMapFunctionSummary *>>
260 StringMapGlobalValueSummary *>>
248261 Module2FunctionInfoMap(ModuleCount);
249262
250263 for (auto &GlobalList : Index) {
251264 auto GUID = GlobalList.first;
252265 for (auto &GlobInfo : GlobalList.second) {
253 auto *Summary = dyn_cast_or_null(GlobInfo->summary());
254 if (!Summary)
266 auto *Summary = GlobInfo->summary();
267 if (isa(Summary))
255268 /// Ignore global variable, focus on functions
256269 continue;
270 if (auto *AS = dyn_cast(Summary))
271 if (isa(&AS->getAliasee()))
272 /// Ignore alias to global variable, focus on functions
273 continue;
257274 DEBUG(dbgs() << "Adding definition: Module '" << Summary->modulePath()
258275 << "' defines '" << GUID << "'\n");
259276 Module2FunctionInfoMap[Summary->modulePath()][GUID] = Summary;
294311
295312 // Collect the list of functions this module defines.
296313 // GUID -> Summary
297 std::mapFunctionSummary *> FunctionInfoMap;
314 std::mapGlobalValueSummary *> FunctionInfoMap;
298315 Index.collectDefinedFunctionsForModule(ModulePath, FunctionInfoMap);
299316
300317 // Compute the import list for this module.
357374 GlobalsToImport.insert(&GV);
358375 }
359376 }
377 for (auto &GV : SrcModule->globals()) {
378 if (!GV.hasName())
379 continue;
380 auto GUID = GV.getGUID();
381 auto Import = ImportGUIDs.count(GUID);
382 DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing " << GUID << " "
383 << GV.getName() << " from " << SrcModule->getSourceFileName()
384 << "\n");
385 if (Import) {
386 GV.materialize();
387 GlobalsToImport.insert(&GV);
388 }
389 }
360390 for (auto &GV : SrcModule->aliases()) {
361391 if (!GV.hasName())
362392 continue;
369399 // Alias can't point to "available_externally". However when we import
370400 // linkOnceODR the linkage does not change. So we import the alias
371401 // and aliasee only in this case.
372 const GlobalObject *GO = GV.getBaseObject();
402 GlobalObject *GO = GV.getBaseObject();
373403 if (!GO->hasLinkOnceODRLinkage())
374404 continue;
375 GV.materialize();
376 GlobalsToImport.insert(&GV);
405 #ifndef NDEBUG
406 if (!GlobalsToImport.count(GO))
407 DEBUG(dbgs() << " alias triggers importing aliasee " << GO->getGUID()
408 << " " << GO->getName() << " from "
409 << SrcModule->getSourceFileName() << "\n");
410 #endif
411 GO->materialize();
377412 GlobalsToImport.insert(GO);
378 }
379 }
380 for (auto &GV : SrcModule->globals()) {
381 if (!GV.hasName())
382 continue;
383 auto GUID = GV.getGUID();
384 auto Import = ImportGUIDs.count(GUID);
385 DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing " << GUID << " "
386 << GV.getName() << " from " << SrcModule->getSourceFileName()
387 << "\n");
388 if (Import) {
389413 GV.materialize();
390414 GlobalsToImport.insert(&GV);
391415 }
463487 static char ID;
464488
465489 /// Specify pass name for debug output
466 const char *getPassName() const override {
467 return "Function Importing";
468 }
490 const char *getPassName() const override { return "Function Importing"; }
469491
470492 explicit FunctionImportPass(const ModuleSummaryIndex *Index = nullptr)
471493 : ModulePass(ID), Index(Index) {}
0 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1 target triple = "x86_64-unknown-linux-gnu"
2
3
4
5 @analias = alias void (...), bitcast (void ()* @aliasee to void (...)*)
6
7 ; Function Attrs: nounwind uwtable
8 define void @aliasee() #0 {
9 entry:
10 ret void
11 }
12
0 ; Test to check the callgraph in summary
1 ; RUN: opt -module-summary %s -o %t.o
2 ; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
3 ; RUN: opt -module-summary %p/Inputs/thinlto-alias.ll -o %t2.o
4 ; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
5 ; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
6
7 ; CHECK:
8 ; See if the call to func is registered, using the expected callsite count
9 ; and value id matching the subsequent value symbol table.
10 ; CHECK-NEXT:
11 ; CHECK-NEXT:
12 ; CHECK-NEXT:
13 ; CHECK-NEXT:
14 ; External function analias should have entry with value id FUNCID
15 ; CHECK-NEXT:
16 ; CHECK-NEXT:
17
18 ; COMBINED:
19 ; See if the call to analias is registered, using the expected callsite count
20 ; and value id matching the subsequent value symbol table.
21 ; COMBINED-NEXT:
22 ; Followed by the alias and aliasee
23 ; COMBINED-NEXT:
24 ; COMBINED-NEXT:
25 ; COMBINED-NEXT:
26 ; COMBINED-NEXT:
27 ; Entry for function func should have entry with value id ALIASID
28 ; COMBINED-NEXT:
29 ; COMBINED-NEXT:
30 ; COMBINED-NEXT:
31 ; COMBINED-NEXT:
32
33 ; ModuleID = 'thinlto-function-summary-callgraph.ll'
34 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
35 target triple = "x86_64-unknown-linux-gnu"
36
37 ; Function Attrs: nounwind uwtable
38 define i32 @main() {
39 entry:
40 call void (...) @analias()
41 ret i32 0
42 }
43
44 declare void @analias(...)
None ; RUN: opt -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
0 ; RUN: opt -name-anon-functions -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
11 ; Check for summary block/records.
22
33 ; Check the value ids in the summary entries against the
66 ; BC:
77 ; BC-NEXT:
88 ; BC-NEXT:
9 ; BC-NEXT:
10 ; BC-NEXT:
911 ; BC-NEXT:
1012 ; BC-NEXT:
13 ; BC-NEXT: record string = 'anon.
1114 ; BC-NEXT: record string = 'foo'
1215 ; BC-NEXT: record string = 'bar'
1316 ; BC-NEXT: record string = 'f'
1417
15 ; RUN: opt -module-summary < %s | llvm-dis | FileCheck %s
18 ; RUN: opt -name-anon-functions -module-summary < %s | llvm-dis | FileCheck %s
1619 ; Check that this round-trips correctly.
1720
1821 ; ModuleID = ''
8686 ; INSTLIM5-DAG: declare hidden void @funcwithpersonality.llvm.{{.*}}()
8787
8888 ; INSTLIMDEF-DAG: Import globalfunc2
89 ; INSTLIMDEF-DAG: 9 function-import - Number of functions imported
89 ; INSTLIMDEF-DAG: 11 function-import - Number of functions imported
9090
9191 ; The actual GUID values will depend on path to test.
9292 ; GUID-DAG: GUID {{.*}} is weakalias
307307 STRINGIFY_CODE(FS, COMBINED)
308308 STRINGIFY_CODE(FS, COMBINED_PROFILE)
309309 STRINGIFY_CODE(FS, COMBINED_GLOBALVAR_INIT_REFS)
310 STRINGIFY_CODE(FS, ALIAS)
311 STRINGIFY_CODE(FS, COMBINED_ALIAS)
310312 }
311313 case bitc::METADATA_ATTACHMENT_ID:
312314 switch(CodeID) {