|
LLVM
5.0.0
|
Class to hold module path string table and global value map, and encapsulate methods for operating on them. More...
#include "llvm/IR/ModuleSummaryIndex.h"
Public Types | |
| typedef ModulePathStringTableTy::value_type | ModuleInfo |
Public Member Functions | |
| gvsummary_iterator | begin () |
| const_gvsummary_iterator | begin () const |
| gvsummary_iterator | end () |
| const_gvsummary_iterator | end () const |
| size_t | size () const |
| bool | withGlobalValueDeadStripping () const |
| void | setWithGlobalValueDeadStripping () |
| bool | isGlobalValueLive (const GlobalValueSummary *GVS) const |
| bool | isGUIDLive (GlobalValue::GUID GUID) const |
| ValueInfo | getValueInfo (GlobalValue::GUID GUID) const |
| Return a ValueInfo for GUID if it exists, otherwise return ValueInfo(). More... | |
| ValueInfo | getOrInsertValueInfo (GlobalValue::GUID GUID) |
Return a ValueInfo for GUID. More... | |
| ValueInfo | getOrInsertValueInfo (const GlobalValue *GV) |
Return a ValueInfo for GV and mark it as belonging to GV. More... | |
| GlobalValue::GUID | getGUIDFromOriginalID (GlobalValue::GUID OriginalID) const |
Return the GUID for OriginalId in the OidGuidMap. More... | |
| std::set< std::string > & | cfiFunctionDefs () |
| const std::set< std::string > & | cfiFunctionDefs () const |
| std::set< std::string > & | cfiFunctionDecls () |
| const std::set< std::string > & | cfiFunctionDecls () const |
| void | addGlobalValueSummary (StringRef ValueName, std::unique_ptr< GlobalValueSummary > Summary) |
| Add a global value summary for a value of the given name. More... | |
| void | addGlobalValueSummary (ValueInfo VI, std::unique_ptr< GlobalValueSummary > Summary) |
| Add a global value summary for the given ValueInfo. More... | |
| void | addOriginalName (GlobalValue::GUID ValueGUID, GlobalValue::GUID OrigGUID) |
| Add an original name for the 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... | |
| ModuleInfo * | addModule (StringRef ModPath, uint64_t ModId, ModuleHash Hash=ModuleHash{{0}}) |
Add a new module with the given Hash, mapped to the given ModID, and return a reference to the module. More... | |
| bool | hasExportedFunctions (const Module &M) const |
| Check if the given Module has any functions available for exporting in the index. More... | |
| const std::map< std::string, TypeIdSummary > & | typeIds () const |
| TypeIdSummary & | getOrInsertTypeIdSummary (StringRef TypeId) |
| This accessor should only be used when exporting because it can mutate the map. More... | |
| const TypeIdSummary * | getTypeIdSummary (StringRef TypeId) const |
| This returns either a pointer to the type id summary (if present in the summary map) or null (if not present). 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 529 of file ModuleSummaryIndex.h.
| typedef ModulePathStringTableTy::value_type llvm::ModuleSummaryIndex::ModuleInfo |
Definition at line 711 of file ModuleSummaryIndex.h.
|
inline |
Add a global value summary for a value of the given name.
Definition at line 613 of file ModuleSummaryIndex.h.
References llvm::GlobalValue::getGUID(), and getOrInsertValueInfo().
Referenced by llvm::buildModuleSummaryIndex(), computeAliasSummary(), computeFunctionSummary(), and computeVariableSummary().
|
inline |
Add a global value summary for the given ValueInfo.
Definition at line 620 of file ModuleSummaryIndex.h.
References addOriginalName(), llvm::ValueInfo::getGUID(), llvm::ValueInfo::Ref, and second.
|
inline |
Add a new module with the given Hash, mapped to the given ModID, and return a reference to the module.
Definition at line 715 of file ModuleSummaryIndex.h.
|
inline |
Add an original name for the value of the given GUID.
Definition at line 630 of file ModuleSummaryIndex.h.
Referenced by addGlobalValueSummary().
|
inline |
Definition at line 564 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 565 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 609 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 610 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 606 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 607 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 21 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 39 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 566 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 567 of file ModuleSummaryIndex.h.
|
inline |
Find the summary for global GUID in module ModuleId, or nullptr if not found.
Definition at line 642 of file ModuleSummaryIndex.h.
References llvm::find_if(), and getValueInfo().
Referenced by computeCacheKey().
|
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 697 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 660 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 50 of file ModuleSummaryIndex.cpp.
References assert(), getValueInfo(), and VI.
|
inline |
Return the GUID for OriginalId in the OidGuidMap.
Definition at line 601 of file ModuleSummaryIndex.h.
References I.
|
inline |
Get the module SHA1 hash recorded for the given module path.
Definition at line 689 of file ModuleSummaryIndex.h.
References assert().
Referenced by computeCacheKey().
Get the module ID recorded for the given module path.
Definition at line 684 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 706 of file ModuleSummaryIndex.h.
References llvm::StringRef::split().
Referenced by llvm::thinLTOInternalizeModule().
|
inline |
This accessor should only be used when exporting because it can mutate the map.
Definition at line 733 of file ModuleSummaryIndex.h.
|
inline |
Return a ValueInfo for GUID.
Definition at line 589 of file ModuleSummaryIndex.h.
Referenced by addGlobalValueSummary(), computeFunctionSummary(), and findRefEdges().
|
inline |
Return a ValueInfo for GV and mark it as belonging to GV.
Definition at line 594 of file ModuleSummaryIndex.h.
References llvm::GlobalValue::getGUID().
|
inline |
This returns either a pointer to the type id summary (if present in the summary map) or null (if not present).
This may be used when importing.
Definition at line 739 of file ModuleSummaryIndex.h.
References I.
|
inline |
Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
Definition at line 583 of file ModuleSummaryIndex.h.
References I.
Referenced by llvm::computeDeadSymbols(), findSummaryInModule(), getGlobalValueSummary(), isGUIDLive(), and setLiveRoot().
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 723 of file ModuleSummaryIndex.h.
References llvm::Module::getModuleIdentifier().
Referenced by llvm::FunctionImportGlobalProcessing::FunctionImportGlobalProcessing().
|
inline |
Definition at line 577 of file ModuleSummaryIndex.h.
Referenced by isGUIDLive().
| bool ModuleSummaryIndex::isGUIDLive | ( | GlobalValue::GUID | GUID | ) | const |
Definition at line 60 of file ModuleSummaryIndex.cpp.
References getValueInfo(), I, isGlobalValueLive(), and VI.
|
inline |
Table of modules, containing module hash and id.
Definition at line 674 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 679 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 573 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 568 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 727 of file ModuleSummaryIndex.h.
|
inline |
Definition at line 570 of file ModuleSummaryIndex.h.
Referenced by llvm::computeDeadSymbols().
1.8.6