llvm.org GIT mirror llvm / e618ec9
Make aliases explicit in the summary 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. Reviewers: tejohnson Subscribers: llvm-commits 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@266214 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 3 years ago
11 changed file(s) with 275 addition(s) and 48 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
58475847 Info->setSummary(std::move(FS));
58485848 break;
58495849 }
5850 // FS_ALIAS: [valueid, linkage, valueid]
5851 // Aliases must be emitted (and parsed) after all FS_PERMODULE entries, as
5852 // they expect all aliasee summaries to be available.
5853 case bitc::FS_ALIAS: {
5854 unsigned ValueID = Record[0];
5855 uint64_t RawLinkage = Record[1];
5856 unsigned AliaseeID = Record[2];
5857 std::unique_ptr AS =
5858 llvm::make_unique(getDecodedLinkage(RawLinkage));
5859 // The module path string ref set in the summary must be owned by the
5860 // index's module string table. Since we don't have a module path
5861 // string table section in the per-module index, we create a single
5862 // module path string table entry with an empty (0) ID to take
5863 // ownership.
5864 AS->setModulePath(
5865 TheIndex->addModulePath(Buffer->getBufferIdentifier(), 0)->first());
5866
5867 GlobalValue::GUID AliaseeGUID = getGUIDFromValueId(AliaseeID);
5868 auto *AliaseeInfo = TheIndex->getGlobalValueInfo(AliaseeGUID);
5869 if (!AliaseeInfo->summary())
5870 return error("Alias expects aliasee summary to be parsed");
5871 AS->setAliasee(AliaseeInfo->summary());
5872
5873 GlobalValue::GUID GUID = getGUIDFromValueId(ValueID);
5874 auto *Info = TheIndex->getGlobalValueInfo(GUID);
5875 assert(!Info->summary() && "Expected a single summary per VST entry");
5876 Info->setSummary(std::move(AS));
5877 break;
5878 }
58505879 // FS_PERMODULE_GLOBALVAR_INIT_REFS: [valueid, linkage, n x valueid]
58515880 case bitc::FS_PERMODULE_GLOBALVAR_INIT_REFS: {
58525881 unsigned ValueID = Record[0];
59055934 Combined = true;
59065935 break;
59075936 }
5937 // FS_COMBINED_ALIAS: [modid, linkage, offset]
5938 // Aliases must be emitted (and parsed) after all FS_PERMODULE entries, as
5939 // they expect all aliasee summaries to be available.
5940 case bitc::FS_COMBINED_ALIAS: {
5941 uint64_t ModuleId = Record[0];
5942 uint64_t RawLinkage = Record[1];
5943 uint64_t AliaseeSummaryOffset = Record[2];
5944 std::unique_ptr AS =
5945 llvm::make_unique(getDecodedLinkage(RawLinkage));
5946 AS->setModulePath(ModuleIdMap[ModuleId]);
5947
5948 auto *AliaseeInfo = getInfoFromSummaryOffset(AliaseeSummaryOffset);
5949 if (!AliaseeInfo->summary())
5950 return error("Alias expects aliasee summary to be parsed");
5951 AS->setAliasee(AliaseeInfo->summary());
5952
5953 auto *Info = getInfoFromSummaryOffset(CurRecordBit);
5954 assert(!Info->summary() && "Expected a single summary per VST entry");
5955 Info->setSummary(std::move(AS));
5956 Combined = true;
5957 break;
5958 }
59085959 // FS_COMBINED_GLOBALVAR_INIT_REFS: [modid, linkage, n x valueid]
59095960 case bitc::FS_COMBINED_GLOBALVAR_INIT_REFS: {
59105961 uint64_t ModuleId = Record[0];
29232923 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
29242924 unsigned FSModRefsAbbrev = Stream.EmitAbbrev(Abbv);
29252925
2926 // Abbrev for FS_ALIAS.
2927 Abbv = new BitCodeAbbrev();
2928 Abbv->Add(BitCodeAbbrevOp(bitc::FS_ALIAS));
2929 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
2930 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // linkage
2931 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // valueid
2932 unsigned FSAliasAbbrev = Stream.EmitAbbrev(Abbv);
2933
29262934 SmallVector NameVals;
29272935 // Iterate over the list of functions instead of the Index to
29282936 // ensure the ordering is stable.
29292937 for (const Function &F : *M) {
29302938 if (F.isDeclaration())
29312939 continue;
2932 // Skip anonymous functions. We will emit a function summary for
2933 // any aliases below.
2940 // We shouldn't have any anonymous functions as they are not supported in
2941 // ThinLTO and should be renamed.
29342942 if (!F.hasName())
2935 continue;
2943 report_fatal_error("Unexpected anonymous function when writing summary");
29362944
29372945 auto *Info = Index.getGlobalValueInfo(F);
29382946 WritePerModuleFunctionSummaryRecord(
29452953 // of a function scope.
29462954 for (const GlobalVariable &G : M->globals())
29472955 WriteModuleLevelReferences(G, Index, VE, NameVals, FSModRefsAbbrev, Stream);
2956
2957 for (const GlobalAlias &A : M->aliases()) {
2958 auto *Aliasee = A.getBaseObject();
2959 if (!Aliasee->hasName())
2960 // Nameless function don't have an entry in the summary, skip it.
2961 continue;
2962 auto AliasId = VE.getValueID(&A);
2963 auto AliaseeId = VE.getValueID(Aliasee);
2964 NameVals.push_back(AliasId);
2965 NameVals.push_back(getEncodedLinkage(A.getLinkage()));
2966 NameVals.push_back(AliaseeId);
2967 Stream.EmitRecord(bitc::FS_ALIAS, NameVals, FSAliasAbbrev);
2968 NameVals.clear();
2969 }
29482970
29492971 Stream.ExitBlock();
29502972 }
29893011 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
29903012 unsigned FSModRefsAbbrev = Stream.EmitAbbrev(Abbv);
29913013
3014 // Abbrev for FS_COMBINED_ALIAS.
3015 Abbv = new BitCodeAbbrev();
3016 Abbv->Add(BitCodeAbbrevOp(bitc::FS_COMBINED_ALIAS));
3017 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // modid
3018 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // linkage
3019 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // offset
3020 unsigned FSAliasAbbrev = Stream.EmitAbbrev(Abbv);
3021
3022 // The aliases are emitted as a post-pass, and will point to the summary
3023 // offset id of the aliasee. For this purpose we need to be able to get back
3024 // from the summary to the offset
3025 SmallVector Aliases;
3026 DenseMap SummaryToOffsetMap;
3027
29923028 SmallVector NameVals;
29933029 for (const auto &FII : Index) {
29943030 for (auto &FI : FII.second) {
29953031 GlobalValueSummary *S = FI->summary();
29963032 assert(S);
3033 if (isa(S)) {
3034 // Will process aliases as a post-pass because the reader wants all
3035 // global to be loaded first.
3036 Aliases.push_back(FI.get());
3037 continue;
3038 }
29973039
29983040 if (auto *VS = dyn_cast(S)) {
29993041 NameVals.push_back(Index.getModuleId(VS->modulePath()));
30163058 // reader will invoke readRecord after the abbrev id read.
30173059 FI->setBitcodeIndex(Stream.GetCurrentBitNo() +
30183060 Stream.GetAbbrevIDWidth());
3061 // Store temporarily the offset in the map for a possible alias.
3062 SummaryToOffsetMap[S] = FI->bitcodeIndex();
30193063
30203064 // Emit the finished record.
30213065 Stream.EmitRecord(bitc::FS_COMBINED_GLOBALVAR_INIT_REFS, NameVals,
30673111 // in the VST entry. Add the current code size since the
30683112 // reader will invoke readRecord after the abbrev id read.
30693113 FI->setBitcodeIndex(Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth());
3114 // Store temporarily the offset in the map for a possible alias.
3115 SummaryToOffsetMap[S] = FI->bitcodeIndex();
30703116
30713117 unsigned FSAbbrev =
30723118 (HasProfileData ? FSCallsProfileAbbrev : FSCallsAbbrev);
30773123 Stream.EmitRecord(Code, NameVals, FSAbbrev);
30783124 NameVals.clear();
30793125 }
3126 }
3127
3128 for (auto GVI : Aliases) {
3129 AliasSummary *AS = cast(GVI->summary());
3130 NameVals.push_back(Index.getModuleId(AS->modulePath()));
3131 NameVals.push_back(getEncodedLinkage(AS->linkage()));
3132 auto AliaseeOffset = SummaryToOffsetMap[&AS->getAliasee()];
3133 assert(AliaseeOffset);
3134 NameVals.push_back(AliaseeOffset);
3135
3136 // Record the starting offset of this summary entry for use
3137 // in the VST entry. Add the current code size since the
3138 // reader will invoke readRecord after the abbrev id read.
3139 GVI->setBitcodeIndex(Stream.GetCurrentBitNo() + Stream.GetAbbrevIDWidth());
3140
3141 // Emit the finished record.
3142 Stream.EmitRecord(bitc::FS_COMBINED_ALIAS, NameVals, FSAliasAbbrev);
3143 NameVals.clear();
30803144 }
30813145
30823146 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: ⏎
9 ; BC: ⏎
1010 ; BC-NEXT:
11 ; BC-NEXT: record string = 'foo'
11 ; BC: record string = 'foo'
1212 ; BC-NEXT: record string = 'bar'
1313 ; BC-NEXT: record string = 'f'
1414
15 ; RUN: opt -module-summary < %s | llvm-dis | FileCheck %s
15 ; RUN: opt -name-anon-functions -module-summary < %s | llvm-dis | FileCheck %s
1616 ; Check that this round-trips correctly.
1717
1818 ; 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) {