I have a problem with getMinusSCEV in isKnownPredicateViaConstantRanges function:
The following is the scenario:
LHS = X,
RHS = -1,
SE already has a computed SCEV (X + 1)<nuw> in the cache. This SCEV corresponds to an instruction at different scope where nuw flag is valid.
I am expecting the "Diff = getMinusSCEV(LHS, RHS)" to be simply (X + 1) instead, I get (X + 1)<nuw> and isKnownNonZero(Diff) returns true which doesn't look correct for me.