This is follow up of https://reviews.llvm.org/D71690.
In this patch, handle nsw as well
Differential D72436
[SCEV] get a more accurate range for AddRecExpr with nsw flag shchenz on Jan 8 2020, 10:34 PM. Authored by
Details
Diff Detail Event Timeline
Comment Actions operand 0 does not required to be NonPos/NonNeg
Comment Actions Logic looks good to me. As @efriedma mentioned some extra tests would be good, especially for the different sign cases. The current test only covers negative start with negative step.
Comment Actions LGTM
|
With the new code, we can skip operand zero (start) here. We only need that the step operands have a known sign so the addrec moves in a known direction, but the sign of the start value doesn't matter.