From ffbee86b8ee5c6d098c172fde955457a716ebd89 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 18 Apr 2007 01:19:55 +0000 Subject: [PATCH] Cache DT[*SI] lookup. llvm-svn: 36239 --- lib/Analysis/PostDominators.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index b239596163f..add25fdf42f 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