forked from OSchip/llvm-project
no really, don't double count these nodes either!
llvm-svn: 20837
This commit is contained in:
parent
b7ffd50537
commit
d21e220035
|
@ -285,34 +285,39 @@ static void printCollection(const Collection &C, std::ostream &O,
|
||||||
DSGraph &Gr = C.getDSGraph((Function&)*I);
|
DSGraph &Gr = C.getDSGraph((Function&)*I);
|
||||||
unsigned NumCalls = Gr.shouldPrintAuxCalls() ?
|
unsigned NumCalls = Gr.shouldPrintAuxCalls() ?
|
||||||
Gr.getAuxFunctionCalls().size() : Gr.getFunctionCalls().size();
|
Gr.getAuxFunctionCalls().size() : Gr.getFunctionCalls().size();
|
||||||
|
bool IsDuplicateGraph = false;
|
||||||
|
|
||||||
if (I->getName() == "main" || !OnlyPrintMain) {
|
if (I->getName() == "main" || !OnlyPrintMain) {
|
||||||
Function *SCCFn = Gr.retnodes_begin()->first;
|
Function *SCCFn = Gr.retnodes_begin()->first;
|
||||||
if (&*I == SCCFn) {
|
if (&*I == SCCFn) {
|
||||||
TotalNumNodes += Gr.getGraphSize();
|
|
||||||
TotalCallNodes += NumCalls;
|
|
||||||
|
|
||||||
Gr.writeGraphToFile(O, Prefix+I->getName());
|
Gr.writeGraphToFile(O, Prefix+I->getName());
|
||||||
} else {
|
} else {
|
||||||
// Don't double count node/call nodes.
|
IsDuplicateGraph = true; // Don't double count node/call nodes.
|
||||||
O << "Didn't write '" << Prefix+I->getName()
|
O << "Didn't write '" << Prefix+I->getName()
|
||||||
<< ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName()
|
<< ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TotalNumNodes += Gr.getGraphSize();
|
Function *SCCFn = Gr.retnodes_begin()->first;
|
||||||
TotalCallNodes += NumCalls;
|
if (&*I == SCCFn) {
|
||||||
O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... ["
|
O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... ["
|
||||||
<< Gr.getGraphSize() << "+" << NumCalls << "]\n";
|
<< Gr.getGraphSize() << "+" << NumCalls << "]\n";
|
||||||
|
} else {
|
||||||
|
IsDuplicateGraph = true; // Don't double count node/call nodes.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GraphSize = Gr.getGraphSize();
|
if (!IsDuplicateGraph) {
|
||||||
if (MaxGraphSize < GraphSize) MaxGraphSize = GraphSize;
|
unsigned GraphSize = Gr.getGraphSize();
|
||||||
|
if (MaxGraphSize < GraphSize) MaxGraphSize = GraphSize;
|
||||||
|
|
||||||
for (DSGraph::node_iterator NI = Gr.node_begin(), E = Gr.node_end();
|
TotalNumNodes += Gr.getGraphSize();
|
||||||
NI != E; ++NI)
|
TotalCallNodes += NumCalls;
|
||||||
if (NI->isNodeCompletelyFolded())
|
for (DSGraph::node_iterator NI = Gr.node_begin(), E = Gr.node_end();
|
||||||
++NumFoldedNodes;
|
NI != E; ++NI)
|
||||||
|
if (NI->isNodeCompletelyFolded())
|
||||||
|
++NumFoldedNodes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DSGraph &GG = C.getGlobalsGraph();
|
DSGraph &GG = C.getGlobalsGraph();
|
||||||
|
|
Loading…
Reference in New Issue