Index: llvm/lib/Analysis/ScalarEvolution.cpp =================================================================== --- llvm/lib/Analysis/ScalarEvolution.cpp +++ llvm/lib/Analysis/ScalarEvolution.cpp @@ -10547,11 +10547,7 @@ return true; return isImpliedCondOperandsHelper(Pred, LHS, RHS, - FoundLHS, FoundRHS) || - // ~x < ~y --> x > y - isImpliedCondOperandsHelper(Pred, LHS, RHS, - getNotSCEV(FoundRHS), - getNotSCEV(FoundLHS)); + FoundLHS, FoundRHS); } /// Is MaybeMinMaxExpr an (U|S)(Min|Max) of Candidate and some other values? Index: llvm/test/Analysis/ScalarEvolution/zext-wrap.ll =================================================================== --- llvm/test/Analysis/ScalarEvolution/zext-wrap.ll +++ llvm/test/Analysis/ScalarEvolution/zext-wrap.ll @@ -15,7 +15,7 @@ ; This cast shouldn't be folded into the addrec. ; CHECK: %tmp = zext i8 %l_95.0.i1 to i16 -; CHECK: --> (zext i8 {0,+,-1}<%bb.i> to i16){{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: 2 +; CHECK: --> (zext i8 {0,+,-1}<%bb.i> to i16){{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: 2 %tmp = zext i8 %l_95.0.i1 to i16