Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp =================================================================== --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1383,9 +1383,9 @@ const SCEV *LHSS = SE->getSCEVAtScope(LHS, L); const SCEV *RHSS = SE->getSCEVAtScope(RHS, L); - // Can we prove it to be trivially true or false? - if (auto EV = SE->evaluatePredicateAt(Pred, LHSS, RHSS, BI)) { - foldExit(L, ExitingBB, /*IsTaken*/ !*EV, DeadInsts); + // Can we prove it to be trivially true? + if (SE->isKnownPredicateAt(Pred, LHSS, RHSS, BI)) { + foldExit(L, ExitingBB, /*IsTaken*/ false, DeadInsts); return true; }