aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LazyCallGraph.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-05-01 12:16:31 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-05-01 12:16:31 +0000
commit034d0d6805fbb658f0d3fff1fef345dcd00fd358 (patch)
treea26b238c1d0174c2c6d140f314db1a2ba8b90e90 /llvm/lib/Analysis/LazyCallGraph.cpp
parent4b096741b4f2d0372cc307873edbace5cc18cda8 (diff)
downloadllvm-034d0d6805fbb658f0d3fff1fef345dcd00fd358.zip
llvm-034d0d6805fbb658f0d3fff1fef345dcd00fd358.tar.gz
llvm-034d0d6805fbb658f0d3fff1fef345dcd00fd358.tar.bz2
[LCG] Don't lookup the child SCC twice. Spotted this by inspection, and
no functionality changed. llvm-svn: 207750
Diffstat (limited to 'llvm/lib/Analysis/LazyCallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/LazyCallGraph.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index f88fc79..276956b 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -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;
}