OSDN Git Service

[LCG] Remove the complex walk of the parent sets to update graph
authorChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 03:37:38 +0000 (03:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 03:37:38 +0000 (03:37 +0000)
pointers.

This is completely unnecessary as we have a trivial list of RefSCCs now
that we can walk.

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

lib/Analysis/LazyCallGraph.cpp

index fbf39a2..690ca7d 100644 (file)
@@ -1699,17 +1699,8 @@ void LazyCallGraph::updateGraphPtrs() {
     }
   }
 
-  // Process all SCCs updating the graph pointers.
-  {
-    SmallVector<RefSCC *, 16> Worklist(LeafRefSCCs.begin(), LeafRefSCCs.end());
-
-    while (!Worklist.empty()) {
-      RefSCC &C = *Worklist.pop_back_val();
-      C.G = this;
-      for (RefSCC &ParentC : C.parents())
-        Worklist.push_back(&ParentC);
-    }
-  }
+  for (auto *RC : PostOrderRefSCCs)
+    RC->G = this;
 }
 
 template <typename RootsT, typename GetBeginT, typename GetEndT,