diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1474,7 +1474,7 @@ m_Br(m_c_ICmp(Pred, m_Specific(IncValue), m_APInt(RHSC)), m_BasicBlock(TrueSucc), m_BasicBlock(FalseSucc)))) { // Check for cases of duplicate successors. - if ((TrueSucc == P->getParent()) != (FalseSucc == P->getParent())) { + if (TrueSucc != FalseSucc) { // If we're using the false successor, invert the predicate. if (FalseSucc == P->getParent()) Pred = CmpInst::getInversePredicate(Pred); @@ -2684,7 +2684,7 @@ m_Br(m_c_ICmp(Pred, m_Specific(U.get()), m_Value(X)), m_BasicBlock(TrueSucc), m_BasicBlock(FalseSucc)))) { // Check for cases of duplicate successors. - if ((TrueSucc == PN->getParent()) != (FalseSucc == PN->getParent())) { + if (TrueSucc != FalseSucc) { // If we're using the false successor, invert the predicate. if (FalseSucc == PN->getParent()) Pred = CmpInst::getInversePredicate(Pred);