Remove redundant check.
authorDevang Patel <dpatel@apple.com>
Tue, 12 Jun 2007 17:35:20 +0000 (17:35 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 12 Jun 2007 17:35:20 +0000 (17:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37561 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Dominators.cpp

index 35b2bbfc224bec8cf3932d2fc3178bba9f173380..74c585fd6a48d4f5afb478cbec11f66ac9e9487c 100644 (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);