diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -10534,7 +10534,7 @@ if (CheckRanges(getSignedRange(LHS), getSignedRange(RHS)) || CheckRanges(getUnsignedRange(LHS), getUnsignedRange(RHS))) return true; - auto *Diff = getMinusSCEV(LHS, RHS); + auto *Diff = getMinusSCEV(LHS, RHS, SCEV::NoWrapMask); return !isa(Diff) && isKnownNonZero(Diff); }