On Thu, 6 Oct 2016, Jakub Jelinek wrote:

For signed a, if we see a >= 0 && a < b and from VR know that b >= 0,
we can optimize those 2 comparisons into one unsigned -
(unsigned) a < (unsigned) b.  Similarly for a < 0 || a > b (and also
for a <= b in the first and a >= b in the second).

I guess that the slightly more general:
X >= A && X < B where we know that A <= B
--> (unsigned)X - (unsigned)A < (unsigned)B - (unsigned)A

generates too many operations and does not gain anything? The case where A and B are constants seems to be handled by ifcombine, currently.

--
Marc Glisse

Reply via email to