aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 22:07:02 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 22:07:02 +0000
commitf40f0a39bdd3846725576caf0d5a3fe261deecad (patch)
treecbcc53a9ce171b851e6158e5c398c1accb542678 /lib/Analysis/DataStructure/DataStructure.cpp
parentdd398486cab0cce9f3b7406248c5d333c63e9ddf (diff)
eliminate the ability to remove global nodes from deadNodeElminate... for now.
This slows stuff down a bit, but it should get much better before it gets any worse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index aab344bb99..cc43544504 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -810,9 +810,9 @@ static void removeIdenticalCalls(vector<DSCallSite> &Calls,
// other nodes in the graph. These nodes will all be trivially unreachable, so
// we don't have to perform any non-trivial analysis here.
//
-void DSGraph::removeTriviallyDeadNodes(bool KeepAllGlobals) {
+void DSGraph::removeTriviallyDeadNodes() {
for (unsigned i = 0; i != Nodes.size(); ++i)
- if (!KeepAllGlobals || !(Nodes[i]->NodeType & DSNode::GlobalNode))
+ if (!(Nodes[i]->NodeType & DSNode::GlobalNode))
if (isNodeDead(Nodes[i])) { // This node is dead!
delete Nodes[i]; // Free memory...
Nodes.erase(Nodes.begin()+i--); // Remove from node list...
@@ -981,9 +981,9 @@ static void markGlobalsAlive(DSGraph &G, std::set<DSNode*> &Alive,
// from the caller's graph entirely. This is only appropriate to use when
// inlining graphs.
//
-void DSGraph::removeDeadNodes(bool KeepAllGlobals) {
+void DSGraph::removeDeadNodes() {
// Reduce the amount of work we have to do...
- removeTriviallyDeadNodes(KeepAllGlobals);
+ removeTriviallyDeadNodes();
// FIXME: Merge nontrivially identical call nodes...
@@ -1012,13 +1012,6 @@ void DSGraph::removeDeadNodes(bool KeepAllGlobals) {
// The return value is alive as well...
markAlive(RetNode.getNode(), Alive);
- // Mark all globals or cast nodes that can reach a live node as alive.
- // This also marks all nodes reachable from such nodes as alive.
- // Of course, if KeepAllGlobals is specified, they would be live already.
-
- if (!KeepAllGlobals)
- markGlobalsAlive(*this, Alive, false);
-
// Loop over all unreachable nodes, dropping their references...
vector<DSNode*> DeadNodes;
DeadNodes.reserve(Nodes.size()); // Only one allocation is allowed.
@@ -1129,23 +1122,6 @@ DSNode* GlobalDSGraph::cloneNodeInto(DSNode *OldNode,
}
-// GlobalDSGraph::cloneGlobals - Clone global nodes and all their externally
-// visible target links (and recursively their such links) into this graph.
-//
-void GlobalDSGraph::cloneGlobals(DSGraph& Graph, bool CloneCalls) {
- std::map<const DSNode*, DSNode*> NodeCache;
-#if 0
- for (unsigned i = 0, N = Graph.Nodes.size(); i < N; ++i)
- if (Graph.Nodes[i]->NodeType & DSNode::GlobalNode)
- GlobalsGraph->cloneNodeInto(Graph.Nodes[i], NodeCache, false);
- if (CloneCalls)
- GlobalsGraph->cloneCalls(Graph);
-
- GlobalsGraph->removeDeadNodes(/*KeepAllGlobals*/ true);
-#endif
-}
-
-
// GlobalDSGraph::cloneCalls - Clone function calls and their visible target
// links (and recursively their such links) into this graph.
//