A skeptical review here is appreciated. I believe this is safe, but overflow code generally makes my brain hurt.
p.s. For step=1, we can also cache the same fact. I am deliberately not doing so to minimize test diffs in this change.
Differential D103844
[SCEV] Cache wrap facts for positive IVs w/LT exits reames on Jun 7 2021, 2:42 PM. Authored by
Details
A skeptical review here is appreciated. I believe this is safe, but overflow code generally makes my brain hurt. p.s. For step=1, we can also cache the same fact. I am deliberately not doing so to minimize test diffs in this change.
Diff Detail Event Timeline
Comment Actions Change appears to be wrong as written, discussing why before adjusting.
|
If we consider the canIVOverflowOnLT() case, the only thin this guarantees is that RHS + Stride - 1 does not overflow, it doesn't make a direct statement about the addrec.
If the loop exits before reaching this exit (for simplicity: abnormal exit on first iteration), then I don't think we can really make any statement about the nowrap behavior of the addrec.