From: Rafael Espindola Date: Sat, 24 Mar 2012 22:52:25 +0000 (+0000) Subject: Avoid using dominatedBySlowTreeWalk. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=42c487d2e529489648176ebb8e9ef022c07ef785;p=oota-llvm.git Avoid using dominatedBySlowTreeWalk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153398 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index c384925e709..0d2222dd0cb 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -338,9 +338,12 @@ public: /// Note that this is not a constant time operation! /// bool properlyDominates(const DomTreeNodeBase *A, - const DomTreeNodeBase *B) const { - if (A == 0 || B == 0) return false; - return dominatedBySlowTreeWalk(A, B); + const DomTreeNodeBase *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(A)), - getNode(const_cast(B))); + return dominates(getNode(const_cast(A)), + getNode(const_cast(B))); } bool dominatedBySlowTreeWalk(const DomTreeNodeBase *A,