[LCG] Don't lookup the child SCC twice. Spotted this by inspection, and
authorChandler Carruth <chandlerc@gmail.com>
Thu, 1 May 2014 12:16:31 +0000 (12:16 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 1 May 2014 12:16:31 +0000 (12:16 +0000)
no functionality changed.

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

lib/Analysis/LazyCallGraph.cpp

index f88fc79fbd78ddfb84a92955384019efcbbe1d33..276956b644dce307d43e0512ebb0bf42a853f43d 100644 (file)
@@ -463,9 +463,9 @@ LazyCallGraph::SCC *LazyCallGraph::formSCC(Node *RootN,
   bool IsLeafSCC = true;
   for (Node *SCCN : NewSCC->Nodes)
     for (Node &SCCChildN : *SCCN) {
-      if (SCCMap.lookup(&SCCChildN) == NewSCC)
-        continue;
       SCC &ChildSCC = *SCCMap.lookup(&SCCChildN);
+      if (&ChildSCC == NewSCC)
+        continue;
       ChildSCC.ParentSCCs.insert(NewSCC);
       IsLeafSCC = false;
     }