diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-02-26 07:38:21 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-02-26 07:38:21 +0000 |
commit | 24b3d258bbeadd4fe50c8664c0638e511e8925c0 (patch) | |
tree | ed13c553365e2c1c76135b2ef256b56989f9e51b /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | c6d54ae9daad8fbcf26bbff2be6844bf05c19f6e (diff) | |
download | llvm-24b3d258bbeadd4fe50c8664c0638e511e8925c0.zip llvm-24b3d258bbeadd4fe50c8664c0638e511e8925c0.tar.gz llvm-24b3d258bbeadd4fe50c8664c0638e511e8925c0.tar.bz2 |
[ThinLTO] Use defined node and edge order when dumping DOT file
Differential revision: https://reviews.llvm.org/D58631
llvm-svn: 354850
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index 5279cd6..6ae6285 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -65,17 +65,6 @@ void ModuleSummaryIndex::collectDefinedFunctionsForModule( } } -// Collect for each module the list of function it defines (GUID -> Summary). -void ModuleSummaryIndex::collectDefinedGVSummariesPerModule( - StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries) const { - for (auto &GlobalList : *this) { - auto GUID = GlobalList.first; - for (auto &Summary : GlobalList.second.SummaryList) { - ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get(); - } - } -} - GlobalValueSummary * ModuleSummaryIndex::getGlobalValueSummary(uint64_t ValueGUID, bool PerModuleIndex) const { @@ -341,7 +330,8 @@ static bool hasReadOnlyFlag(const GlobalValueSummary *S) { void ModuleSummaryIndex::exportToDot(raw_ostream &OS) const { std::vector<Edge> CrossModuleEdges; DenseMap<GlobalValue::GUID, std::vector<uint64_t>> NodeMap; - StringMap<GVSummaryMapTy> ModuleToDefinedGVS; + using GVSOrderedMapTy = std::map<GlobalValue::GUID, GlobalValueSummary *>; + std::map<StringRef, GVSOrderedMapTy> ModuleToDefinedGVS; collectDefinedGVSummariesPerModule(ModuleToDefinedGVS); // Get node identifier in form MXXX_<GUID>. The MXXX prefix is required, @@ -378,12 +368,12 @@ void ModuleSummaryIndex::exportToDot(raw_ostream &OS) const { OS << "digraph Summary {\n"; for (auto &ModIt : ModuleToDefinedGVS) { - auto ModId = getModuleId(ModIt.first()); - OS << " // Module: " << ModIt.first() << "\n"; + auto ModId = getModuleId(ModIt.first); + OS << " // Module: " << ModIt.first << "\n"; OS << " subgraph cluster_" << std::to_string(ModId) << " {\n"; OS << " style = filled;\n"; OS << " color = lightgrey;\n"; - OS << " label = \"" << sys::path::filename(ModIt.first()) << "\";\n"; + OS << " label = \"" << sys::path::filename(ModIt.first) << "\";\n"; OS << " node [style=filled,fillcolor=lightblue];\n"; auto &GVSMap = ModIt.second; |