Lines Matching +full:out +full:- +full:functions
1 //===-- ImportedFunctionsInliningStats.cpp ----------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
8 // Generating inliner statistics for imported functions, mostly useful for
10 //===----------------------------------------------------------------------===//
28 "inliner-function-import-stats",
34 cl::Hidden, cl::desc("Enable inliner stats for imported functions"));
43 ValueLookup->Imported = F.hasMetadata("thinlto_src_module");
59 // functions. In this case the graph would be empty.
71 NonImportedCallers.push_back(It->first());
77 for (const auto &F : M.functions()) {
110 std::string Out;
111 Out.reserve(5000);
112 raw_string_ostream Ostream(Out);
114 Ostream << "------- Dumping inliner stats for [" << ModuleName
115 << "] -------\n";
118 Ostream << "-- List of inlined functions:\n";
121 assert(Node->second->NumberOfInlines >= Node->second->NumberOfRealInlines);
122 if (Node->second->NumberOfInlines == 0)
125 if (Node->second->Imported) {
128 int(Node->second->NumberOfRealInlines > 0);
132 int(Node->second->NumberOfRealInlines > 0);
137 << (Node->second->Imported ? "imported " : "not imported ")
138 << "function [" << Node->first() << "]"
139 << ": #inlines = " << Node->second->NumberOfInlines
141 << Node->second->NumberOfRealInlines << "\n";
146 auto NotImportedFuncCount = AllFunctions - ImportedFunctions;
148 ImportedFunctions - InlinedImportedFunctionsToImportingModuleCount;
150 Ostream << "-- Summary:\n"
151 << "All functions: " << AllFunctions
152 << ", imported functions: " << ImportedFunctions << "\n"
153 << getStatString("inlined functions", InlinedFunctionsCount,
154 AllFunctions, "all functions")
155 << getStatString("imported functions inlined anywhere",
157 "imported functions")
158 << getStatString("imported functions inlined into importing module",
160 ImportedFunctions, "imported functions",
163 ImportedFunctions, "imported functions")
164 << getStatString("non-imported functions inlined anywhere",
166 NotImportedFuncCount, "non-imported functions")
168 "non-imported functions inlined into importing module",
170 NotImportedFuncCount, "non-imported functions");
172 dbgs() << Out;
192 InlinedFunctionNode->NumberOfRealInlines++;
193 if (!InlinedFunctionNode->Visited)
207 if (Lhs->second->NumberOfInlines != Rhs->second->NumberOfInlines)
208 return Lhs->second->NumberOfInlines > Rhs->second->NumberOfInlines;
209 if (Lhs->second->NumberOfRealInlines != Rhs->second->NumberOfRealInlines)
210 return Lhs->second->NumberOfRealInlines >
211 Rhs->second->NumberOfRealInlines;
212 return Lhs->first() < Rhs->first();