summaryrefslogtreecommitdiff
path: root/lib/Analysis/PostDominators.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-04-18 01:19:55 +0000
committerDevang Patel <dpatel@apple.com>2007-04-18 01:19:55 +0000
commit5a713cc72fd56c81e4cccc582f5eb0c731ad7c9f (patch)
tree77871a1ebc7f96a6ea097c5d3671deb03fec4322 /lib/Analysis/PostDominators.cpp
parent8dcd2f1a5bbb9151ec05532861be58bf3f078e63 (diff)
downloadllvm-5a713cc72fd56c81e4cccc582f5eb0c731ad7c9f.tar.gz
llvm-5a713cc72fd56c81e4cccc582f5eb0c731ad7c9f.tar.bz2
llvm-5a713cc72fd56c81e4cccc582f5eb0c731ad7c9f.tar.xz
Cache DT[*SI] lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PostDominators.cpp')
-rw-r--r--lib/Analysis/PostDominators.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index b239596163..add25fdf42 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -282,10 +282,12 @@ PostDominanceFrontier::calculate(const PostDominatorTree &DT,
if (BB)
for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB);
- SI != SE; ++SI)
+ SI != SE; ++SI) {
// Does Node immediately dominate this predecessor?
- if (DT[*SI] && DT[*SI]->getIDom() != Node)
+ DominatorTree::Node *SINode = DT[*SI];
+ if (SINode && SINode->getIDom() != Node)
S.insert(*SI);
+ }
// At this point, S is DFlocal. Now we union in DFup's of our children...
// Loop through and visit the nodes that Node immediately dominates (Node's