Remove redundant check.

llvm-svn: 37561
This commit is contained in:
Devang Patel 2007-06-12 17:35:20 +00:00
parent 2f9d2bcb19
commit 47419ee142
1 changed files with 3 additions and 7 deletions

View File

@ -380,13 +380,6 @@ BasicBlock *DominatorTreeBase::findNearestCommonDominator(BasicBlock *A,
if (A == &Entry || B == &Entry)
return &Entry;
// If A and B are same then A is nearest common dominator.
DomTreeNode *NodeA = getNode(A);
if (A != 0 && A == B)
return A;
DomTreeNode *NodeB = getNode(B);
// If B dominates A then B is nearest common dominator.
if (dominates(B,A))
return B;
@ -395,6 +388,9 @@ BasicBlock *DominatorTreeBase::findNearestCommonDominator(BasicBlock *A,
if (dominates(A,B))
return A;
DomTreeNode *NodeA = getNode(A);
DomTreeNode *NodeB = getNode(B);
// Collect NodeA dominators set.
SmallPtrSet<DomTreeNode*, 16> NodeADoms;
NodeADoms.insert(NodeA);