[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp DataStructure.cpp Local.cpp Steensgaard.cpp TopDownClosure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Nov 9 16:08:00 PST 2002
Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.39 -> 1.40
DataStructure.cpp updated: 1.60 -> 1.61
Local.cpp updated: 1.36 -> 1.37
Steensgaard.cpp updated: 1.12 -> 1.13
TopDownClosure.cpp updated: 1.28 -> 1.29
---
Log message:
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.
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.39 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.40
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.39 Sat Nov 9 15:12:06 2002
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Sat Nov 9 16:06:59 2002
@@ -154,7 +154,7 @@
if (Inlined) {
Graph->maskIncompleteMarkers();
Graph->markIncompleteNodes();
- Graph->removeDeadNodes(/*KeepAllGlobals*/ true);
+ Graph->removeDeadNodes();
}
} while (Inlined && !FCs.empty());
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.60 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.61
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.60 Sat Nov 9 15:02:26 2002
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Sat Nov 9 16:06:59 2002
@@ -810,9 +810,9 @@
// 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 @@
// 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 @@
// 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.
@@ -1126,23 +1119,6 @@
NewNode->NodeType &= ~(DSNode::AllocaNode | DSNode::ScalarNode);
return NewNode;
-}
-
-
-// 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
}
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.36 llvm/lib/Analysis/DataStructure/Local.cpp:1.37
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.36 Sat Nov 9 15:12:06 2002
+++ llvm/lib/Analysis/DataStructure/Local.cpp Sat Nov 9 16:06:59 2002
@@ -134,7 +134,7 @@
markIncompleteNodes();
// Remove any nodes made dead due to merging...
- removeDeadNodes(true);
+ removeDeadNodes();
}
Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.12 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.13
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.12 Sat Nov 9 15:00:47 2002
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Sat Nov 9 16:06:59 2002
@@ -194,7 +194,7 @@
ResultGraph->markIncompleteNodes(false);
// Remove any nodes that are dead after all of the merging we have done...
- ResultGraph->removeDeadNodes(true);
+ ResultGraph->removeDeadNodes();
DEBUG(print(std::cerr, &M));
return false;
Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.28 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.29
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.28 Sat Nov 9 15:12:06 2002
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Sat Nov 9 16:06:59 2002
@@ -186,7 +186,7 @@
CG.maskIncompleteMarkers();
CG.markIncompleteNodes(/*markFormals*/ !F.hasInternalLinkage()
/*&& FIXME: NEED TO CHECK IF ALL CALLERS FOUND!*/);
- CG.removeDeadNodes(/*KeepAllGlobals*/ false);
+ CG.removeDeadNodes();
}
DEBUG(std::cerr << " [TD] Done inlining into callees for: " << F.getName()
More information about the llvm-commits
mailing list