23 for (
auto &GlobalList : *
this) {
24 auto GUID = GlobalList.first;
25 for (
auto &GlobSummary : GlobalList.second.SummaryList) {
26 auto *Summary = dyn_cast_or_null<FunctionSummary>(GlobSummary.get());
31 if (Summary->modulePath() != ModulePath)
33 GVSummaryMap[GUID] = Summary;
41 for (
auto &GlobalList : *
this) {
42 auto GUID = GlobalList.first;
43 for (
auto &Summary : GlobalList.second.SummaryList) {
44 ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get();
51 bool PerModuleIndex)
const {
53 assert(
VI &&
"GlobalValue not found in index");
54 assert((!PerModuleIndex ||
VI.getSummaryList().size() == 1) &&
55 "Expected a single entry per global value in per-module index");
56 auto &Summary =
VI.getSummaryList()[0];
64 const auto &SummaryList =
VI.getSummaryList();
65 if (SummaryList.empty())
67 for (
auto &
I : SummaryList)
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
ValueInfo getValueInfo(GlobalValue::GUID GUID) const
Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
bool isGlobalValueLive(const GlobalValueSummary *GVS) const
void collectDefinedFunctionsForModule(StringRef ModulePath, GVSummaryMapTy &GVSummaryMap) const
Collect for the given module the list of function it defines (GUID -> Summary).
Function and variable summary information to aid decisions and implementation of importing.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
void collectDefinedGVSummariesPerModule(StringMap< GVSummaryMapTy > &ModuleToDefinedGVSummaries) const
Collect for each module the list of Summaries it defines (GUID -> Summary).
bool isGUIDLive(GlobalValue::GUID GUID) const
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
GlobalValueSummary * getGlobalValueSummary(const GlobalValue &GV, bool PerModuleIndex=true) const
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex.
StringRef - Represent a constant reference to a string, i.e.