Home | History | Annotate | Download | only in IPO

Lines Matching refs:Summary

1 //===- FunctionImport.cpp - ThinLTO Summary-based Function Import ---------===//
91 // Return true if the Summary describes a GlobalValue that can be externally
94 static bool canBeExternallyReferenced(const GlobalValueSummary &Summary) {
95 if (!Summary.needsRenaming())
98 if (Summary.hasSection())
124 // Return true if the global described by \p Summary can be imported in another
127 const GlobalValueSummary &Summary) {
128 if (!canBeExternallyReferenced(Summary))
137 llvm::all_of(Summary.refs(), [&](const ValueInfo &VI) {
143 if (auto *FuncSummary = dyn_cast<FunctionSummary>(&Summary)) {
186 auto *Summary = cast<FunctionSummary>(GVSummary);
188 if (Summary->instCount() > Threshold)
191 if (!eligibleForImport(Index, *Summary))
202 /// Return the summary for the function \p GUID that fits the \p Threshold, or
209 return nullptr; // This function does not have a summary
224 // This global does not have a summary, it is not part of the ThinLTO
229 [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
230 return Summary->modulePath() == ExportModulePath;
237 auto *Summary = FindGlobalSummaryInModule(GUID);
238 if (!Summary)
243 auto GVS = dyn_cast<GlobalVarSummary>(Summary);
250 // FIXME: with a "isConstant" flag in the summary we could be more targetted.
266 const FunctionSummary &Summary, const ModuleSummaryIndex &Index,
271 for (auto &Edge : Summary.calls()) {
282 DEBUG(dbgs() << "ignored! No qualifying callee with summary found.\n");
285 // "Resolve" the summary, traversing alias,
347 auto *Summary = GVSummary.second;
348 if (auto *AS = dyn_cast<AliasSummary>(Summary))
349 Summary = &AS->getAliasee();
350 auto *FuncSummary = dyn_cast<FunctionSummary>(Summary);
362 auto *Summary = FuncInfo.first;
369 computeImportForFunction(*Summary, Index, Threshold, DefinedGVSummaries,
415 // GUID -> Summary
454 "Expected a defined summary for imported global value");
476 /// Fixup WeakForLinker linkages in \p TheModule based on summary analysis.
482 // See if the global summary analysis computed a new resolved linkage.
528 // name so that we can access the correct summary and see if it can
686 /// Summary file to use for function importing when using -function-import from
689 SummaryFile("summary-file",
690 cl::desc("The summary file to use for function importing."));
699 /// Parse the summary index out of an IR file and return the summary
723 /// Pass that performs cross-module function import provided a summary file.
725 /// Optional module summary index to use for importing, otherwise
726 /// the summary-file option must be specified.
744 report_fatal_error("error: -function-import requires -summary-file or "
749 report_fatal_error("error: -summary-file and index from frontend\n");
786 "Summary Based Function Import", false, false)
788 "Summary Based Function Import", false, false)