aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-03 19:11:38 +0000
committerChris Lattner <sabre@nondot.org>2003-02-03 19:11:38 +0000
commit20167e3c6ded47c6da72c729bd73e5a9eade7f8c (patch)
treed47f724e8b7e91d5500e222504a9ce2c2cece0ff /lib/Analysis/DataStructure/BottomUpClosure.cpp
parent5a939029d5cf285f2b8714a3cc9e608437fe3ead (diff)
downloadexternal_llvm-20167e3c6ded47c6da72c729bd73e5a9eade7f8c.zip
external_llvm-20167e3c6ded47c6da72c729bd73e5a9eade7f8c.tar.gz
external_llvm-20167e3c6ded47c6da72c729bd73e5a9eade7f8c.tar.bz2
Add better debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 8fa331c..1d33975 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -109,6 +109,7 @@ public:
//
bool BUDataStructures::run(Module &M) {
GlobalsGraph = new DSGraph();
+ GlobalsGraph->setPrintAuxCalls();
Function *MainFunc = M.getMainFunction();
if (MainFunc)
@@ -336,9 +337,10 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
- << " in: " << F.getName() << "[" << GI.getGraphSize() << "+"
- << GI.getAuxFunctionCalls().size() << "]\n");
-
+ << "[" << GI.getGraphSize() << "+"
+ << GI.getAuxFunctionCalls().size() << "] into: " << F.getName()
+ << "[" << Graph.getGraphSize() << "+"
+ << Graph.getAuxFunctionCalls().size() << "]\n");
#if 0
Graph.writeGraphToFile(std::cerr, "bu_" + F.getName() + "_before_" +
Callee->getName());
@@ -366,6 +368,7 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
// now that are complete, we must loop!
Graph.maskIncompleteMarkers();
Graph.markIncompleteNodes(DSGraph::MarkFormalArgs);
+ // FIXME: materialize nodes from the globals graph as neccesary...
Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
@@ -420,10 +423,12 @@ DSGraph &BUDataStructures::inlineNonSCCGraphs(Function &F,
// Get the data structure graph for the called function.
//
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
-
+
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
- << " in: " << F.getName() << "[" << GI.getGraphSize() << "+"
- << GI.getAuxFunctionCalls().size() << "]\n");
+ << "[" << GI.getGraphSize() << "+"
+ << GI.getAuxFunctionCalls().size() << "] into: " << F.getName()
+ << "[" << Graph.getGraphSize() << "+"
+ << Graph.getAuxFunctionCalls().size() << "]\n");
// Handle self recursion by resolving the arguments and return value
Graph.mergeInGraph(CS, GI,
@@ -447,7 +452,7 @@ DSGraph &BUDataStructures::inlineNonSCCGraphs(Function &F,
DEBUG(std::cerr << " [BU] Done Non-SCC inlining: " << F.getName() << " ["
<< Graph.getGraphSize() << "+" << Graph.getAuxFunctionCalls().size()
<< "]\n");
-
+ //Graph.writeGraphToFile(std::cerr, "nscc_" + F.getName());
return Graph;
}
@@ -466,7 +471,7 @@ DSGraph &BUDataStructures::calculateSCCGraph(Function &F,
// the new call site list and doesn't invalidate our iterators!
std::vector<DSCallSite> TempFCs;
TempFCs.swap(AuxCallsList);
-
+
// Loop over all of the resolvable call sites
unsigned LastCallSiteIdx = ~0U;
CallSiteIterator I = CallSiteIterator::begin(TempFCs),
@@ -505,10 +510,11 @@ DSGraph &BUDataStructures::calculateSCCGraph(Function &F,
// Get the data structure graph for the called function.
//
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
-
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
- << " in: " << F.getName() << "[" << GI.getGraphSize() << "+"
- << GI.getAuxFunctionCalls().size() << "]\n");
+ << "[" << GI.getGraphSize() << "+"
+ << GI.getAuxFunctionCalls().size() << "] into: " << F.getName()
+ << "[" << Graph.getGraphSize() << "+"
+ << Graph.getAuxFunctionCalls().size() << "]\n");
// Handle self recursion by resolving the arguments and return value
Graph.mergeInGraph(CS, GI,
@@ -537,12 +543,14 @@ DSGraph &BUDataStructures::calculateSCCGraph(Function &F,
// now that are complete, we must loop!
Graph.maskIncompleteMarkers();
Graph.markIncompleteNodes(DSGraph::MarkFormalArgs);
+
+ // FIXME: materialize nodes from the globals graph as neccesary...
+
Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
<< Graph.getGraphSize() << "+" << Graph.getAuxFunctionCalls().size()
<< "]\n");
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
-
return Graph;
}