Avoid using dominatedBySlowTreeWalk.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 24 Mar 2012 22:52:25 +0000 (22:52 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 24 Mar 2012 22:52:25 +0000 (22:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153398 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index c384925e7091f31f8a03f9e16a2186e1903e1ce4..0d2222dd0cbc14ef044da663e32cc30f65167827 100644 (file)
@@ -338,9 +338,12 @@ public:
   /// Note that this is not a constant time operation!
   ///
   bool properlyDominates(const DomTreeNodeBase<NodeT> *A,
-                         const DomTreeNodeBase<NodeT> *B) const {
-    if (A == 0 || B == 0) return false;
-    return dominatedBySlowTreeWalk(A, B);
+                         const DomTreeNodeBase<NodeT> *B) {
+    if (A == 0 || B == 0)
+      return false;
+    if (A == B)
+      return false;
+    return dominates(A, B);
   }
 
   inline bool properlyDominates(const NodeT *A, const NodeT *B) {
@@ -350,8 +353,8 @@ public:
     // Cast away the const qualifiers here. This is ok since
     // this function doesn't actually return the values returned
     // from getNode.
-    return properlyDominates(getNode(const_cast<NodeT *>(A)),
-                             getNode(const_cast<NodeT *>(B)));
+    return dominates(getNode(const_cast<NodeT *>(A)),
+                     getNode(const_cast<NodeT *>(B)));
   }
 
   bool dominatedBySlowTreeWalk(const DomTreeNodeBase<NodeT> *A,