|
LLVM
4.0.0
|
Class to hold module path string table and global value map, and encapsulate methods for operating on them. More...
#include <ModuleSummaryIndex.h>
Public Member Functions | |
| gvsummary_iterator | begin () |
| const_gvsummary_iterator | begin () const |
| gvsummary_iterator | end () |
| const_gvsummary_iterator | end () const |
| size_t | size () const |
| const GlobalValueSummaryList & | getGlobalValueSummaryList (StringRef ValueName) |
| Get the list of global value summary objects for a given value name. More... | |
| const const_gvsummary_iterator | findGlobalValueSummaryList (StringRef ValueName) const |
| Get the list of global value summary objects for a given value name. More... | |
| const const_gvsummary_iterator | findGlobalValueSummaryList (GlobalValue::GUID ValueGUID) const |
| Get the list of global value summary objects for a given value GUID. More... | |
| void | addGlobalValueSummary (StringRef ValueName, std::unique_ptr< GlobalValueSummary > Summary) |
| Add a global value summary for a value of the given name. More... | |
| void | addGlobalValueSummary (GlobalValue::GUID ValueGUID, std::unique_ptr< GlobalValueSummary > Summary) |
| Add a global value summary for a value of the given GUID. More... | |
| GlobalValueSummary * | findSummaryInModule (GlobalValue::GUID ValueGUID, StringRef ModuleId) const |
Find the summary for global GUID in module ModuleId, or nullptr if not found. More... | |
| GlobalValueSummary * | getGlobalValueSummary (const GlobalValue &GV, bool PerModuleIndex=true) const |
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex. More... | |
| GlobalValueSummary * | getGlobalValueSummary (GlobalValue::GUID ValueGUID, bool PerModuleIndex=true) const |
Returns the first GlobalValueSummary for ValueGUID, asserting that there is only one if PerModuleIndex. More... | |
| const StringMap< std::pair < uint64_t, ModuleHash > > & | modulePaths () const |
| Table of modules, containing module hash and id. More... | |
| StringMap< std::pair< uint64_t, ModuleHash > > & | modulePaths () |
| Table of modules, containing hash and id. More... | |
| uint64_t | getModuleId (const StringRef ModPath) const |
| Get the module ID recorded for the given module path. More... | |
| const ModuleHash & | getModuleHash (const StringRef ModPath) const |
| Get the module SHA1 hash recorded for the given module path. More... | |
| void | mergeFrom (std::unique_ptr< ModuleSummaryIndex > Other, uint64_t NextModuleId) |
| Add the given per-module index into this module index/summary, assigning it the given module ID. More... | |
| ModulePathStringTableTy::iterator | addModulePath (StringRef ModPath, uint64_t ModId, ModuleHash Hash=ModuleHash{{0}}) |
Add a new module path with the given Hash, mapped to the given ModID, and return an iterator to the entry in the index. More... | |
| bool | hasExportedFunctions (const Module &M) const |
| Check if the given Module has any functions available for exporting in the index. More... | |
| void | removeEmptySummaryEntries () |
| Remove entries in the GlobalValueMap that have empty summaries due to the eager nature of map entry creation during VST parsing. More... | |
| void | collectDefinedFunctionsForModule (StringRef ModulePath, GVSummaryMapTy &GVSummaryMap) const |
| Collect for the given module the list of function it defines (GUID -> Summary). More... | |
| void | collectDefinedGVSummariesPerModule (StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries) const |
| Collect for each module the list of Summaries it defines (GUID -> Summary). More... | |
Static Public Member Functions | |
| static std::string | getGlobalNameForLocal (StringRef Name, ModuleHash ModHash) |
| Convenience method for creating a promoted global name for the given value name of a local, and its original module's ID. More... | |
| static StringRef | getOriginalNameBeforePromote (StringRef Name) |
| Helper to obtain the unpromoted name for a global value (or the original name if not promoted). More... | |
Class to hold module path string table and global value map, and encapsulate methods for operating on them.
Definition at line 361 of file ModuleSummaryIndex.h.
|
inline |
Add a global value summary for a value of the given name.
Definition at line 403 of file ModuleSummaryIndex.h.
References llvm::GlobalValue::getGUID().
Referenced by computeAliasSummary(), computeFunctionSummary(), computeVariableSummary(), and mergeFrom().
|
inline |
Add a global value summary for a value of the given GUID.
Definition at line 410 of file ModuleSummaryIndex.h.
|
inline |
Add a new module path with the given Hash, mapped to the given ModID, and return an iterator to the entry in the index.
Definition at line 496 of file ModuleSummaryIndex.h.
Referenced by mergeFrom().
|
inline |
Definition at line 379 of file ModuleSummaryIndex.h.
Referenced by removeEmptySummaryEntries().
|
inline |
Definition at line 380 of file ModuleSummaryIndex.h.
| void ModuleSummaryIndex::collectDefinedFunctionsForModule | ( | StringRef | ModulePath, |
| GVSummaryMapTy & | GVSummaryMap | ||
| ) | const |
Collect for the given module the list of function it defines (GUID -> Summary).
Definition at line 69 of file ModuleSummaryIndex.cpp.
Referenced by llvm::ComputeCrossModuleImportForModule().
| void ModuleSummaryIndex::collectDefinedGVSummariesPerModule | ( | StringMap< GVSummaryMapTy > & | ModuleToDefinedGVSummaries | ) | const |
Collect for each module the list of Summaries it defines (GUID -> Summary).
Definition at line 87 of file ModuleSummaryIndex.cpp.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), llvm::ThinLTOCodeGenerator::promote(), and llvm::ThinLTOCodeGenerator::run().
|
inline |
Definition at line 381 of file ModuleSummaryIndex.h.
Referenced by findSummaryInModule(), getGlobalValueSummary(), removeEmptySummaryEntries(), and setLiveRoot().
|
inline |
Definition at line 382 of file ModuleSummaryIndex.h.
|
inline |
Get the list of global value summary objects for a given value name.
Definition at line 392 of file ModuleSummaryIndex.h.
References llvm::GlobalValue::getGUID().
Referenced by findSummaryInModule(), getGlobalValueSummary(), and setLiveRoot().
|
inline |
Get the list of global value summary objects for a given value GUID.
Definition at line 398 of file ModuleSummaryIndex.h.
|
inline |
Find the summary for global GUID in module ModuleId, or nullptr if not found.
Definition at line 417 of file ModuleSummaryIndex.h.
References end(), llvm::find_if(), and findGlobalValueSummaryList().
|
inlinestatic |
Convenience method for creating a promoted global name for the given value name of a local, and its original module's ID.
Definition at line 479 of file ModuleSummaryIndex.h.
References llvm::SmallString< InternalLen >::str(), and llvm::utohexstr().
|
inline |
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex.
Definition at line 435 of file ModuleSummaryIndex.h.
References assert(), llvm::GlobalValue::getGUID(), llvm::Value::getName(), and llvm::Value::hasName().
Referenced by llvm::buildModuleSummaryIndex(), and computeAliasSummary().
| GlobalValueSummary * ModuleSummaryIndex::getGlobalValueSummary | ( | GlobalValue::GUID | ValueGUID, |
| bool | PerModuleIndex = true |
||
| ) | const |
Returns the first GlobalValueSummary for ValueGUID, asserting that there is only one if PerModuleIndex.
Definition at line 98 of file ModuleSummaryIndex.cpp.
References assert(), end(), and findGlobalValueSummaryList().
|
inline |
Get the list of global value summary objects for a given value name.
Definition at line 386 of file ModuleSummaryIndex.h.
References llvm::GlobalValue::getGUID().
|
inline |
Get the module SHA1 hash recorded for the given module path.
Definition at line 464 of file ModuleSummaryIndex.h.
References assert().
Referenced by computeCacheKey().
Get the module ID recorded for the given module path.
Definition at line 459 of file ModuleSummaryIndex.h.
|
inlinestatic |
Helper to obtain the unpromoted name for a global value (or the original name if not promoted).
Definition at line 488 of file ModuleSummaryIndex.h.
References llvm::StringRef::split().
Check if the given Module has any functions available for exporting in the index.
We consider any module present in the ModulePathStringTable to have exported functions.
Definition at line 506 of file ModuleSummaryIndex.h.
References llvm::Module::getModuleIdentifier().
Referenced by llvm::FunctionImportGlobalProcessing::FunctionImportGlobalProcessing().
| void ModuleSummaryIndex::mergeFrom | ( | std::unique_ptr< ModuleSummaryIndex > | Other, |
| uint64_t | NextModuleId | ||
| ) |
Add the given per-module index into this module index/summary, assigning it the given module ID.
Each module merged in should have a unique ID, necessary for consistent renaming of promoted static (local) variables.
Definition at line 21 of file ModuleSummaryIndex.cpp.
References addGlobalValueSummary(), addModulePath(), assert(), llvm::StringRef::begin(), and List.
Referenced by llvm::ThinLTOCodeGenerator::linkCombinedIndex().
|
inline |
Table of modules, containing module hash and id.
Definition at line 449 of file ModuleSummaryIndex.h.
Referenced by llvm::ThinLTOCodeGenerator::crossModuleImport(), llvm::ThinLTOCodeGenerator::emitImports(), llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule(), llvm::ThinLTOCodeGenerator::internalize(), and llvm::ThinLTOCodeGenerator::promote().
|
inline |
Table of modules, containing hash and id.
Definition at line 454 of file ModuleSummaryIndex.h.
| void ModuleSummaryIndex::removeEmptySummaryEntries | ( | ) |
Remove entries in the GlobalValueMap that have empty summaries due to the eager nature of map entry creation during VST parsing.
These would also be suppressed during combined index generation in mergeFrom(), but if there was only one module or this was the first module we might not invoke mergeFrom.
Definition at line 55 of file ModuleSummaryIndex.cpp.
|
inline |
Definition at line 383 of file ModuleSummaryIndex.h.
1.8.6