10 #ifndef LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H 11 #define LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H 24 #include <system_error> 25 #include <unordered_set> 84 : VI(VI), MaxHotness(MaxHotness), Reason(Reason), Attempts(Attempts) {}
94 std::unique_ptr<ImportFailureInfo>>>;
106 std::function<Expected<std::unique_ptr<Module>>(
StringRef Identifier)>;
110 : Index(Index), ModuleLoader(
std::move(ModuleLoader)) {}
205 std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex);
210 const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex);
224 #endif // LLVM_TRANSFORMS_IPO_FUNCTIONIMPORT_H
ImportFailureInfo(ValueInfo VI, CalleeInfo::HotnessType MaxHotness, ImportFailureReason Reason, unsigned Attempts)
void thinLTOResolvePrevailingInModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals)
Resolve prevailing symbol linkages in TheModule based on the information recorded in the summaries du...
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
Implements a dense probed hash-table based set.
std::error_code EmitImportsFiles(StringRef ModulePath, StringRef OutputFilename, const std::map< std::string, GVSummaryMapTy > &ModuleToSummariesForIndex)
Emit into OutputFilename the files module ModulePath will import from.
bool convertToDeclaration(GlobalValue &GV)
Converts value GV to declaration, or replaces with a declaration if it is an alias.
An efficient, type-erasing, non-owning reference to a callable.
FunctionImporter(const ModuleSummaryIndex &Index, ModuleLoaderTy ModuleLoader)
Create a Function Importer.
std::unordered_set< GlobalValue::GUID > ExportSetTy
The set contains an entry for every global value the module exports.
Tagged union holding either a T or a Error.
static cl::opt< std::string > OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-"))
A CRTP mix-in to automatically provide informational APIs needed for passes.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
ImportFailureReason Reason
The function importing pass.
A set of analyses that are preserved following a run of a transformation pass.
void gatherImportedSummariesForModule(StringRef ModulePath, const StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries, const FunctionImporter::ImportMapTy &ImportList, std::map< std::string, GVSummaryMapTy > &ModuleToSummariesForIndex)
Compute the set of summaries needed for a ThinLTO backend compilation of ModulePath.
ImportFailureReason
The different reasons selectCallee will chose not to import a candidate.
PrevailingType
PrevailingType enum used as a return type of callback passed to computeDeadSymbols.
void ComputeCrossModuleImportForModuleFromIndex(StringRef ModulePath, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportList)
Mark all external summaries in Index for import into the given module.
CalleeInfo::HotnessType MaxHotness
Function and variable summary information to aid decisions and implementation of importing.
Struct that holds a reference to a particular GUID in a global value summary.
std::function< Expected< std::unique_ptr< Module > >(StringRef Identifier)> ModuleLoaderTy
A function of this type is used to load modules referenced by the index.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Expected< bool > importFunctions(Module &M, const ImportMapTy &ImportList)
Import functions in Module M based on the supplied import list.
void ComputeCrossModuleImport(const ModuleSummaryIndex &Index, const StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries, StringMap< FunctionImporter::ImportMapTy > &ImportLists, StringMap< FunctionImporter::ExportSetTy > &ExportLists)
Compute all the imports and exports for every module in the Index.
void thinLTOInternalizeModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals)
Internalize TheModule based on the information recorded in the summaries during global summary-based ...
Information optionally tracked for candidates the importer decided not to import. ...
void ComputeCrossModuleImportForModule(StringRef ModulePath, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportList)
Compute all the imports for the given module using the Index.
void computeDeadSymbolsWithConstProp(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.
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
std::unordered_set< GlobalValue::GUID > FunctionsToImportTy
Set of functions to import from a source module.
The function importer is automatically importing function from other modules based on the provided su...
void computeDeadSymbols(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...
StringRef - Represent a constant reference to a string, i.e.
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.