Fix a bug where we would incorrectly delete globals which had edges to alive nodes in
authorChris Lattner <sabre@nondot.org>
Sat, 1 Feb 2003 06:51:17 +0000 (06:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 1 Feb 2003 06:51:17 +0000 (06:51 +0000)
a graph in the t-d pass.  This slows down the TD pass by quite a bit (1/3), but is
needed for correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5464 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index f1b6e420bb9d82ea0e648d35cc2be3f523952d1f..2c9a75c9a858022723ebdf6bc1c2eaec74ab0aa4 100644 (file)
@@ -973,9 +973,6 @@ static bool CanReachAliveNodes(DSNode *N, hash_set<DSNode*> &Alive,
   if (Visited.count(N)) return false;  // Found a cycle
   Visited.insert(N);   // No recursion, insert into Visited...
 
-  if (N->NodeType & DSNode::GlobalNode)
-    return false; // Global nodes will be marked on their own
-
   for (unsigned i = 0, e = N->getSize(); i < e; i += DS::PointerSize)
     if (CanReachAliveNodes(N->getLink(i).getNode(), Alive, Visited)) {
       N->markReachableNodes(Alive);