aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 20:55:24 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 20:55:24 +0000
commit96517253a1d26c9248ff42065f118d41f3835fc0 (patch)
tree1a5d2adb3e18ce4919eed5763fea74f231785cb0 /lib/Analysis/DataStructure
parent3ce235a161b8738ea3bf781c2306cf6540a59269 (diff)
Make removeTriviallyDeadNodes a private interface of DSGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp3
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp3
-rw-r--r--lib/Analysis/DataStructure/Local.cpp6
-rw-r--r--lib/Analysis/DataStructure/Steensgaard.cpp2
-rw-r--r--lib/Analysis/DataStructure/TopDownClosure.cpp1
5 files changed, 7 insertions, 8 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index ec9e0db9e4..1a3f48002f 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -154,10 +154,11 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
}
} while (Inlined && !FCs.empty());
+#if 0
Graph->maskIncompleteMarkers();
Graph->markIncompleteNodes();
- Graph->removeTriviallyDeadNodes(false);
Graph->removeDeadNodes(/*KeepAllGlobals*/ true, /*KeepCalls*/ true);
+#endif
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
<< Graph->getGraphSize() << "+" << Graph->getFunctionCalls().size()
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 584031bade..630ec5f4d3 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -772,8 +772,7 @@ static void removeRefsToGlobal(DSNode* N,
//
bool DSGraph::isNodeDead(DSNode *N) {
// Is it a trivially dead shadow node...
- if (N->getReferrers().empty() &&
- (N->NodeType == 0 || N->NodeType == DSNode::DEAD))
+ if (N->getReferrers().empty() && (N->NodeType & ~DSNode::DEAD) == 0)
return true;
// Is it a function node or some other trivially unused global?
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index e731d5cb7b..3df4fd4f60 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -74,9 +74,6 @@ namespace {
getValueDest(*I);
visit(G.getFunction()); // Single pass over the function
-
- // Not inlining, only eliminate trivially dead nodes.
- G.removeTriviallyDeadNodes();
}
private:
@@ -135,6 +132,9 @@ DSGraph::DSGraph(Function &F, DSGraph *GG) : Func(&F), GlobalsGraph(GG) {
// Use the graph builder to construct the local version of the graph
GraphBuilder B(*this, Nodes, RetNode, ScalarMap, FunctionCalls);
markIncompleteNodes();
+
+ // Remove any nodes made dead due to merging...
+ removeDeadNodes(true, true);
}
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index aad8657d1d..5ee4dc4cec 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -194,7 +194,7 @@ bool Steens::run(Module &M) {
ResultGraph->markIncompleteNodes(false);
// Remove any nodes that are dead after all of the merging we have done...
- ResultGraph->removeTriviallyDeadNodes();
+ ResultGraph->removeDeadNodes(true, true);
DEBUG(print(std::cerr, &M));
return false;
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp
index 36d8aca78c..ee559d6fc0 100644
--- a/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -180,7 +180,6 @@ void TDDataStructures::calculateGraph(Function &F) {
CG.maskIncompleteMarkers();
CG.markIncompleteNodes(/*markFormals*/ !F.hasInternalLinkage()
/*&& FIXME: NEED TO CHECK IF ALL CALLERS FOUND!*/);
- CG.removeTriviallyDeadNodes(false);
CG.removeDeadNodes(false, true) ;///*KeepAllGlobals*/ false, true);
///*KeepCalls*/ false);
}