This preserves NSW flag for AddRecs multiplied by -1 if we can prove via constant ranges that the AddRec cannot be signed minimum.
An explanation: Let M be signed minimum. If AddRec's range contains M, then M * (-1) will stay M and (M + 1) * (-1) will be signed maximum, so we get a signed overflow.
In all other cases if an AddRec didn't signed overflow, then AddRec * (-1) wouldn't too.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can you please rebase this to current main? It doesn't apply cleanly.
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
3203 | No need to check this if there's no nsw flag in the first place? |
No need to check this if there's no nsw flag in the first place?