summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-20 21:34:07 +0000
committerChris Lattner <sabre@nondot.org>2003-09-20 21:34:07 +0000
commitcc81b798e49b102bf5d57269b539071d22b5c042 (patch)
tree8a38986cb2f86c196357e11ab9202de750f62680 /llvm/lib
parentc8dfbbbf25ea886df52dac3fcb7260a902ea8b22 (diff)
downloadbcm5719-llvm-cc81b798e49b102bf5d57269b539071d22b5c042.tar.gz
bcm5719-llvm-cc81b798e49b102bf5d57269b539071d22b5c042.zip
Remove trivially dead nodes was not removing nodes that were dead due to forwarding!
llvm-svn: 8634
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 0a6fa57aa07..bdf8d810fb6 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -1228,6 +1228,20 @@ void DSGraph::removeTriviallyDeadNodes() {
removeIdenticalCalls(FunctionCalls);
removeIdenticalCalls(AuxFunctionCalls);
+ // Loop over all of the nodes in the graph, calling getNode on each field.
+ // This will cause all nodes to update their forwarding edges, causing
+ // forwarded nodes to be delete-able.
+ for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
+ DSNode *N = Nodes[i];
+ for (unsigned l = 0, e = N->getNumLinks(); l != e; ++l)
+ N->getLink(l*N->getPointerSize()).getNode();
+ }
+
+ // Likewise, forward any edges from the scalar nodes...
+ for (ScalarMapTy::iterator I = ScalarMap.begin(), E = ScalarMap.end();
+ I != E; ++I)
+ I->second.getNode();
+
bool isGlobalsGraph = !GlobalsGraph;
for (unsigned i = 0; i != Nodes.size(); ++i) {
OpenPOWER on IntegriCloud