In getPreStartForSignExtend (ScalarEvolution.cpp) we have

const SCEV *PreStart = SE->getAddExpr(DiffOps, SA->getNoWrapFlags());

If I understand the code correctly, we cannot unconditionally transfer

the no-wrap flags from SA to PreStart. "SCEVAddExpr(X, Step, Y) does

not signed-overflow" does not imply "SCEVAddExpr(X, Y) does not

sign-overflow" [1].

Note: I've assumed that a SCEVAddExpr(a_0, a_1, a_2 ... a_{n-1}) is

said to sign-overflow if

sext(a_0 + a_1 + a_2 .. a_{n-1}) != sext(a_0) + sext(a_1) +

sext(a_2) .. sext(a_{n-1})

Is this correct? This is the only semantics I could think of that

makes sense for a commutative operation.

-- Sanjoy

[1]: e.g. X = INT_SIGNED_MAX, Step = -1, Y = 1