Commit e08f9894 authored by Dmitry Makogon's avatar Dmitry Makogon
Browse files

[SCEV] Preserve NSW for AddRec multiplied by -1 if it cannot be signed minimum

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.

Differential Revision: https://reviews.llvm.org/D148084
parent c97b7bcf
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment