LLVM 24.0.0git
FunctionImport.h
Go to the documentation of this file.
1//===- llvm/Transforms/IPO/FunctionImport.h - ThinLTO importing -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H
10#define LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H
11
12#include "llvm/ADT/DenseSet.h"
13#include "llvm/ADT/MapVector.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/IR/GlobalValue.h"
17#include "llvm/IR/PassManager.h"
19#include "llvm/Support/Error.h"
20#include <functional>
21#include <memory>
22#include <system_error>
23#include <utility>
24
25namespace llvm {
26
27class Module;
28namespace cl {
30}
31
32/// The function importer is automatically importing function from other modules
33/// based on the provided summary informations.
35public:
36 /// The different reasons selectCallee will chose not to import a
37 /// candidate.
40 // We can encounter a global variable instead of a function in rare
41 // situations with SamplePGO. See comments where this failure type is
42 // set for more details.
44 // Found to be globally dead, so we don't bother importing.
46 // Instruction count over the current threshold.
48 // Don't import something with interposable linkage as we can't inline it
49 // anyway.
51 // Generally we won't end up failing due to this reason, as we expect
52 // to find at least one summary for the GUID that is global or a local
53 // in the referenced module for direct calls.
55 // This corresponds to the NotEligibleToImport being set on the summary,
56 // which can happen in a few different cases (e.g. local that can't be
57 // renamed or promoted because it is referenced on a llvm*.used variable).
59 // This corresponds to NoInline being set on the function summary,
60 // which will happen if it is known that the inliner will not be able
61 // to inline the function (e.g. it is marked with a NoInline attribute).
63 };
64
65 /// Information optionally tracked for candidates the importer decided
66 /// not to import. Used for optional stat printing.
68 // The ValueInfo corresponding to the candidate. We save an index hash
69 // table lookup for each GUID by stashing this here.
71 // The maximum call edge hotness for all failed imports of this candidate.
73 // most recent reason for failing to import (doesn't necessarily correspond
74 // to the attempt with the maximum hotness).
76 // The number of times we tried to import candidate but failed.
77 unsigned Attempts;
81 };
82
83 /// Map of callee GUID considered for import into a given module to a pair
84 /// consisting of the largest threshold applied when deciding whether to
85 /// import it and, if we decided to import, a pointer to the summary instance
86 /// imported. If we decided not to import, the summary will be nullptr.
89 std::tuple<unsigned, const GlobalValueSummary *,
90 std::unique_ptr<ImportFailureInfo>>>;
91
92 // Issues import IDs. Each ID uniquely corresponds to a tuple of
93 // (FromModule, GUID, Definition/Declaration).
94 //
95 // The import IDs make the import list space efficient by referring to each
96 // import with a 32-bit integer ID while maintaining a central table that maps
97 // those integer IDs to tuples of (FromModule, GUID, Def/Decl).
98 //
99 // In one large application, a pair of (FromModule, GUID) is mentioned in
100 // import lists more than 50 times on average across all destination modules.
101 // Mentioning the 32-byte tuple:
102 //
103 // std::tuple<StringRef, GlobalValue::GUID, GlobalValueSummary::ImportKind>
104 //
105 // 50 times by value in various import lists would be costly. We can reduce
106 // the memory footprint of import lists by placing one copy in a central table
107 // and referring to it with 32-bit integer IDs.
108 //
109 // To save space within the central table, we only store pairs of
110 // (FromModule, GUID) in the central table. In the actual 32-bit integer ID,
111 // the top 31 bits index into the central table while the bottom 1 bit
112 // indicates whether an ID is for GlobalValueSummary::Declaration or
113 // GlobalValueSummary::Definition.
115 public:
117
118 ImportIDTable() = default;
119
120 // Something is wrong with the application logic if we need to make a copy
121 // of this and potentially make a fork.
122 ImportIDTable(const ImportIDTable &) = delete;
124
125 // Create a pair of import IDs [Def, Decl] for a given pair of FromModule
126 // and GUID.
127 std::pair<ImportIDTy, ImportIDTy> createImportIDs(StringRef FromModule,
128 GlobalValue::GUID GUID) {
129 auto Key = std::make_pair(FromModule, GUID);
130 auto InsertResult = TheTable.try_emplace(Key, TheTable.size());
131 return makeIDPair(InsertResult.first->second);
132 }
133
134 // Get a pair of previously created import IDs [Def, Decl] for a given pair
135 // of FromModule and GUID. Returns std::nullopt if not available.
136 std::optional<std::pair<ImportIDTy, ImportIDTy>>
138 auto Key = std::make_pair(FromModule, GUID);
139 auto It = TheTable.find(Key);
140 if (It != TheTable.end())
141 return makeIDPair(It->second);
142 return std::nullopt;
143 }
144
145 // Return a tuple of [FromModule, GUID, Def/Decl] that a given ImportID
146 // corresponds to.
147 std::tuple<StringRef, GlobalValue::GUID, GlobalValueSummary::ImportKind>
148 lookup(ImportIDTy ImportID) const {
150 (ImportID & 1) ? GlobalValueSummary::Declaration
152 auto It = TheTable.begin() + (ImportID >> 1);
153 StringRef FromModule = It->first.first;
154 GlobalValue::GUID GUID = It->first.second;
155 return std::make_tuple(FromModule, GUID, Kind);
156 }
157
158 // The same as lookup above. Useful for map_iterator.
159 std::tuple<StringRef, GlobalValue::GUID, GlobalValueSummary::ImportKind>
161 return lookup(ImportID);
162 }
163
164 private:
165 // Make a pair of import IDs [Def, Decl] from an index into TheTable.
166 static std::pair<ImportIDTy, ImportIDTy> makeIDPair(ImportIDTy Index) {
167 ImportIDTy Def = Index << 1;
168 ImportIDTy Decl = Def | 1;
169 return std::make_pair(Def, Decl);
170 }
171
173 };
174
175 // Forward-declare SortedImportList for ImportMapTy.
176 class SortedImportList;
177
178 /// The map maintains the list of imports. Conceptually, it is a collection
179 /// of tuples of the form:
180 ///
181 /// (The name of the source module, GUID, Definition/Declaration)
182 ///
183 /// The name of the source module is the module identifier to pass to the
184 /// ModuleLoader. The module identifier strings must be owned elsewhere,
185 /// typically by the in-memory ModuleSummaryIndex the importing decisions are
186 /// made from (the module path for each summary is owned by the index's module
187 /// path string table).
189 public:
191 // No change was made to the list of imports or whether each import should
192 // be imported as a declaration or definition.
194 // Successfully added the given GUID to be imported as a definition. There
195 // was no existing entry with the same GUID as a declaration.
197 // An existing with the given GUID was changed to a definition.
199 };
200
201 ImportMapTy() = delete;
202 ImportMapTy(ImportIDTable &IDs) : IDs(IDs) {}
203
204 // Add the given GUID to ImportList as a definition. If the same GUID has
205 // been added as a declaration previously, that entry is overridden.
207 GlobalValue::GUID GUID);
208
209 // Add the given GUID to ImportList as a declaration. If the same GUID has
210 // been added as a definition previously, that entry takes precedence, and
211 // no change is made.
212 LLVM_ABI void maybeAddDeclaration(StringRef FromModule,
213 GlobalValue::GUID GUID);
214
215 void addGUID(StringRef FromModule, GlobalValue::GUID GUID,
217 if (ImportKind == GlobalValueSummary::Definition)
218 addDefinition(FromModule, GUID);
219 else
220 maybeAddDeclaration(FromModule, GUID);
221 }
222
223 // Return the list of source modules sorted in the ascending alphabetical
224 // order.
226
227 LLVM_ABI std::optional<GlobalValueSummary::ImportKind>
228 getImportType(StringRef FromModule, GlobalValue::GUID GUID) const;
229
230 // Iterate over the import list. The caller gets tuples of FromModule,
231 // GUID, and ImportKind instead of import IDs. std::cref below prevents
232 // map_iterator from deep-copying IDs.
233 auto begin() const { return map_iterator(Imports.begin(), std::cref(IDs)); }
234 auto end() const { return map_iterator(Imports.end(), std::cref(IDs)); }
235
236 friend class SortedImportList;
237
238 private:
239 ImportIDTable &IDs;
241 };
242
243 // A read-only copy of ImportMapTy with its contents sorted according to the
244 // given comparison function.
246 public:
249 bool(const std::pair<StringRef, GlobalValue::GUID> &,
250 const std::pair<StringRef, GlobalValue::GUID> &)>
251 Comp)
252 : IDs(ImportMap.IDs), Imports(iterator_range(ImportMap.Imports)) {
255 auto Lookup = [&](ImportIDTable::ImportIDTy Id)
256 -> std::pair<StringRef, GlobalValue::GUID> {
257 auto Tuple = IDs.lookup(Id);
258 return std::make_pair(std::get<0>(Tuple), std::get<1>(Tuple));
259 };
260 return Comp(Lookup(L), Lookup(R));
261 });
262 }
263
264 // Iterate over the import list. The caller gets tuples of FromModule,
265 // GUID, and ImportKind instead of import IDs. std::cref below prevents
266 // map_iterator from deep-copying IDs.
267 auto begin() const { return map_iterator(Imports.begin(), std::cref(IDs)); }
268 auto end() const { return map_iterator(Imports.end(), std::cref(IDs)); }
269
270 private:
271 const ImportIDTable &IDs;
273 };
274
275 // A map from destination modules to lists of imports.
277 public:
278 ImportListsTy() : ImportIDs(), EmptyList(ImportIDs) {}
280 : ImportIDs(), EmptyList(ImportIDs), ListsImpl(Size) {}
281
283 return ListsImpl.try_emplace(DestMod, ImportIDs).first->second;
284 }
285
286 const ImportMapTy &lookup(StringRef DestMod) const {
287 auto It = ListsImpl.find(DestMod);
288 if (It != ListsImpl.end())
289 return It->second;
290 return EmptyList;
291 }
292
293 size_t size() const { return ListsImpl.size(); }
294
296 const_iterator begin() const { return ListsImpl.begin(); }
297 const_iterator end() const { return ListsImpl.end(); }
298
299 private:
300 ImportIDTable ImportIDs;
301 ImportMapTy EmptyList;
303 };
304
305 /// The set contains an entry for every global value that the module exports.
306 /// Depending on the user context, this container is allowed to contain
307 /// definitions, declarations or a mix of both.
309
310 /// A function of this type is used to load modules referenced by the index.
312 std::function<Expected<std::unique_ptr<Module>>(StringRef Identifier)>;
313
314 /// Create a Function Importer.
316 bool ClearDSOLocalOnDeclarations)
317 : Index(Index), ModuleLoader(std::move(ModuleLoader)),
318 ClearDSOLocalOnDeclarations(ClearDSOLocalOnDeclarations) {}
319
320 /// Import functions in Module \p M based on the supplied import list.
322 const ImportMapTy &ImportList);
323
325
326private:
327 /// The summaries index used to trigger importing.
328 const ModuleSummaryIndex &Index;
329
330 /// Factory function to load a Module for a given identifier
331 ModuleLoaderTy ModuleLoader;
332
333 /// See the comment of ClearDSOLocalOnDeclarations in
334 /// Utils/FunctionImportUtils.h.
335 bool ClearDSOLocalOnDeclarations;
336};
337
338/// The function importing pass
339class FunctionImportPass : public OptionalPassInfoMixin<FunctionImportPass> {
340public:
342};
343
344/// Compute all the imports and exports for every module in the Index.
345///
346/// \p ModuleToDefinedGVSummaries contains for each Module a map
347/// (GUID -> Summary) for every global defined in the module.
348///
349/// \p isPrevailing is a callback that will be called with a global value's GUID
350/// and summary and should return whether the module corresponding to the
351/// summary contains the linker-prevailing copy of that value.
352///
353/// \p ImportLists will be populated with an entry for every Module we are
354/// importing into. This entry is itself a map that can be passed to
355/// FunctionImporter::importFunctions() above (see description there).
356///
357/// \p ExportLists contains for each Module the set of globals (GUID) that will
358/// be imported by another module, or referenced by such a function. I.e. this
359/// is the set of globals that need to be promoted/renamed appropriately.
360///
361/// The module identifier strings that are the keys of the above two maps
362/// are owned by the in-memory ModuleSummaryIndex the importing decisions
363/// are made from (the module path for each summary is owned by the index's
364/// module path string table).
366 const cl::LibraryOptionsContext &LibraryOptions,
367 const ModuleSummaryIndex &Index,
368 const DenseMap<StringRef, GVSummaryMapTy> &ModuleToDefinedGVSummaries,
370 isPrevailing,
373
374/// PrevailingType enum used as a return type of callback passed
375/// to computeDeadSymbolsAndUpdateIndirectCalls. Yes and No values used when
376/// status explicitly set by symbols resolution, otherwise status is Unknown.
377enum class PrevailingType { Yes, No, Unknown };
378
379/// Update call edges for indirect calls to local functions added from
380/// SamplePGO when needed. Normally this is done during
381/// computeDeadSymbolsAndUpdateIndirectCalls, but can be called standalone
382/// when that is not called (e.g. during testing).
383LLVM_ABI void updateIndirectCalls(ModuleSummaryIndex &Index);
384
385/// Compute all the symbols that are "dead": i.e these that can't be reached
386/// in the graph from any of the given symbols listed in
387/// \p GUIDPreservedSymbols. Non-prevailing symbols are symbols without a
388/// prevailing copy anywhere in IR and are normally dead, \p isPrevailing
389/// predicate returns status of symbol.
390/// Also update call edges for indirect calls to local functions added from
391/// SamplePGO when needed.
393 const cl::LibraryOptionsContext &LibraryOptions, ModuleSummaryIndex &Index,
394 const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
395 function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing);
396
397/// Compute dead symbols and run constant propagation in combined index
398/// after that.
400 const cl::LibraryOptionsContext &LibraryOptions, ModuleSummaryIndex &Index,
401 const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
402 function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing,
403 bool ImportEnabled);
404
405/// Converts value \p GV to declaration, or replaces with a declaration if
406/// it is an alias. Returns true if converted, false if replaced.
407LLVM_ABI bool convertToDeclaration(GlobalValue &GV);
408
409/// Compute the set of summaries needed for a ThinLTO backend compilation of
410/// \p ModulePath.
411//
412/// This includes summaries from that module (in case any global summary based
413/// optimizations were recorded) and from any definitions in other modules that
414/// should be imported.
415//
416/// \p ModuleToSummariesForIndex will be populated with the needed summaries
417/// from each required module path. Use a std::map instead of StringMap to get
418/// stable order for bitcode emission.
419///
420/// \p DecSummaries will be popluated with the subset of of summary pointers
421/// that have 'declaration' import type among all summaries the module need.
423 StringRef ModulePath,
424 const DenseMap<StringRef, GVSummaryMapTy> &ModuleToDefinedGVSummaries,
425 const FunctionImporter::ImportMapTy &ImportList,
426 ModuleToSummariesForIndexTy &ModuleToSummariesForIndex,
427 GVSummaryPtrSet &DecSummaries);
428
429/// Emit into \p OutputFilename the files module \p ModulePath will import from.
430LLVM_ABI Error
431EmitImportsFiles(StringRef ModulePath, StringRef OutputFilename,
432 const ModuleToSummariesForIndexTy &ModuleToSummariesForIndex);
433
434/// Call \p F passing each of the files module \p ModulePath will import from.
436 StringRef ModulePath,
437 const ModuleToSummariesForIndexTy &ModuleToSummariesForIndex,
438 function_ref<void(const std::string &)> F);
439
440/// Based on the information recorded in the summaries during global
441/// summary-based analysis:
442/// 1. Resolve prevailing symbol linkages and constrain visibility (CanAutoHide
443/// and consider visibility from other definitions for ELF) in \p TheModule
444/// 2. (optional) Apply propagated function attributes to \p TheModule if
445/// PropagateAttrs is true
447 const GVSummaryMapTy &DefinedGlobals,
448 bool PropagateAttrs);
449
450/// Internalize \p TheModule based on the information recorded in the summaries
451/// during global summary-based analysis.
453 const GVSummaryMapTy &DefinedGlobals);
454
455} // end namespace llvm
456
457#endif // LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define LLVM_ABI
Definition Compiler.h:211
This file defines the DenseSet and SmallDenseSet classes.
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
Machine Check Debug Module
static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))
This file implements a map that provides insertion order iteration.
static cl::opt< bool > PropagateAttrs("propagate-attrs", cl::init(true), cl::Hidden, cl::desc("Propagate attributes in index"))
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
static int Lookup(ArrayRef< TableEntry > Table, unsigned Opcode)
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > const_iterator
Definition DenseMap.h:679
Implements a dense probed hash-table based set.
Definition DenseSet.h:283
Tagged union holding either a T or a Error.
Definition Error.h:485
The function importing pass.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
std::pair< ImportIDTy, ImportIDTy > createImportIDs(StringRef FromModule, GlobalValue::GUID GUID)
ImportIDTable(const ImportIDTable &)=delete
ImportIDTable & operator=(const ImportIDTable &)=delete
std::tuple< StringRef, GlobalValue::GUID, GlobalValueSummary::ImportKind > lookup(ImportIDTy ImportID) const
std::optional< std::pair< ImportIDTy, ImportIDTy > > getImportIDs(StringRef FromModule, GlobalValue::GUID GUID)
std::tuple< StringRef, GlobalValue::GUID, GlobalValueSummary::ImportKind > operator()(ImportIDTable::ImportIDTy ImportID) const
const ImportMapTy & lookup(StringRef DestMod) const
DenseMap< StringRef, ImportMapTy >::const_iterator const_iterator
ImportMapTy & operator[](StringRef DestMod)
The map maintains the list of imports.
LLVM_ABI AddDefinitionStatus addDefinition(StringRef FromModule, GlobalValue::GUID GUID)
void addGUID(StringRef FromModule, GlobalValue::GUID GUID, GlobalValueSummary::ImportKind ImportKind)
LLVM_ABI SmallVector< StringRef, 0 > getSourceModules() const
LLVM_ABI std::optional< GlobalValueSummary::ImportKind > getImportType(StringRef FromModule, GlobalValue::GUID GUID) const
LLVM_ABI void maybeAddDeclaration(StringRef FromModule, GlobalValue::GUID GUID)
SortedImportList(const ImportMapTy &ImportMap, llvm::function_ref< bool(const std::pair< StringRef, GlobalValue::GUID > &, const std::pair< StringRef, GlobalValue::GUID > &)> Comp)
LLVM_ABI Expected< bool > importFunctions(Module &M, const ImportMapTy &ImportList)
Import functions in Module M based on the supplied import list.
DenseMap< GlobalValue::GUID, std::tuple< unsigned, const GlobalValueSummary *, std::unique_ptr< ImportFailureInfo > > > ImportThresholdsTy
Map of callee GUID considered for import into a given module to a pair consisting of the largest thre...
static LLVM_ABI bool forceImportAll(const cl::LibraryOptionsContext &C)
FunctionImporter(const ModuleSummaryIndex &Index, ModuleLoaderTy ModuleLoader, bool ClearDSOLocalOnDeclarations)
Create a Function Importer.
ImportFailureReason
The different reasons selectCallee will chose not to import a candidate.
DenseSet< ValueInfo > ExportSetTy
The set contains an entry for every global value that the module exports.
std::function< Expected< std::unique_ptr< Module > >(StringRef Identifier)> ModuleLoaderTy
A function of this type is used to load modules referenced by the index.
Function and variable summary information to aid decisions and implementation of importing.
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
This class implements a map that also provides access to all stored values in a deterministic order.
Definition MapVector.h:39
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
An efficient, type-erasing, non-owning reference to a callable.
A range adaptor for a pair of iterators.
This namespace contains all of the command line option processing machinery.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void computeDeadSymbolsWithConstProp(const cl::LibraryOptionsContext &LibraryOptions, ModuleSummaryIndex &Index, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols, function_ref< PrevailingType(GlobalValue::GUID)> isPrevailing, bool ImportEnabled)
Compute dead symbols and run constant propagation in combined index after that.
@ Unknown
Not known to have no common set bits.
DenseMap< GlobalValue::GUID, GlobalValueSummary * > GVSummaryMapTy
Map of global value GUID to its summary, used to identify values defined in a particular module,...
mapped_iterator< ItTy, FuncTy > map_iterator(ItTy I, FuncTy F)
Definition STLExtras.h:359
LLVM_ABI bool convertToDeclaration(GlobalValue &GV)
Converts value GV to declaration, or replaces with a declaration if it is an alias.
void sort(IteratorTy Start, IteratorTy End)
Definition STLExtras.h:1652
LLVM_ABI void computeDeadSymbolsAndUpdateIndirectCalls(const cl::LibraryOptionsContext &LibraryOptions, ModuleSummaryIndex &Index, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols, function_ref< PrevailingType(GlobalValue::GUID)> isPrevailing)
Compute all the symbols that are "dead": i.e these that can't be reached in the graph from any of the...
std::map< std::string, GVSummaryMapTy, std::less<> > ModuleToSummariesForIndexTy
Map of a module name to the GUIDs and summaries we will import from that module.
LLVM_ABI void ComputeCrossModuleImport(const cl::LibraryOptionsContext &LibraryOptions, const ModuleSummaryIndex &Index, const DenseMap< StringRef, GVSummaryMapTy > &ModuleToDefinedGVSummaries, function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing, FunctionImporter::ImportListsTy &ImportLists, DenseMap< StringRef, FunctionImporter::ExportSetTy > &ExportLists)
Compute all the imports and exports for every module in the Index.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI void updateIndirectCalls(ModuleSummaryIndex &Index)
Update call edges for indirect calls to local functions added from SamplePGO when needed.
LLVM_ABI void thinLTOInternalizeModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals)
Internalize TheModule based on the information recorded in the summaries during global summary-based ...
LLVM_ABI void gatherImportedSummariesForModule(StringRef ModulePath, const DenseMap< StringRef, GVSummaryMapTy > &ModuleToDefinedGVSummaries, const FunctionImporter::ImportMapTy &ImportList, ModuleToSummariesForIndexTy &ModuleToSummariesForIndex, GVSummaryPtrSet &DecSummaries)
Compute the set of summaries needed for a ThinLTO backend compilation of ModulePath.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1933
LLVM_ABI void processImportsFiles(StringRef ModulePath, const ModuleToSummariesForIndexTy &ModuleToSummariesForIndex, function_ref< void(const std::string &)> F)
Call F passing each of the files module ModulePath will import from.
PrevailingType
PrevailingType enum used as a return type of callback passed to computeDeadSymbolsAndUpdateIndirectCa...
SmallPtrSet< GlobalValueSummary *, 0 > GVSummaryPtrSet
A set of global value summary pointers.
LLVM_ABI Error EmitImportsFiles(StringRef ModulePath, StringRef OutputFilename, const ModuleToSummariesForIndexTy &ModuleToSummariesForIndex)
Emit into OutputFilename the files module ModulePath will import from.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
LLVM_ABI void thinLTOFinalizeInModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals, bool PropagateAttrs)
Based on the information recorded in the summaries during global summary-based analysis:
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:879
ImportFailureInfo(ValueInfo VI, CalleeInfo::HotnessType MaxHotness, ImportFailureReason Reason, unsigned Attempts)
A CRTP mix-in for passes that can be skipped.
Struct that holds a reference to a particular GUID in a global value summary.