mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[ThinLTO] Use defined node and edge order when dumping DOT file
Differential revision: https://reviews.llvm.org/D58631 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user