On 6/11/2021 5:54 AM, Richard Biener via Gcc-patches wrote:
On Thu, Jun 10, 2021 at 9:45 PM Roger Sayle <ro...@nextmovesoftware.com> wrote:

The patch implements a missed optimization enhancement.  Under usual
IEEE rules, x+0.0 can't be simplified to x when x might potentially
be an IEEE minus zero (-0.0).  The current logic in the middle-end
checks whether the type of x should honor signed zeros, but with this
patch we introduce tree_expr_maybe_real_minus_zero_p that allows us
to confirm that the value can't possibly be -0.0, for example, the result
of a conversion from an integer type, or the result of fabs (or has a
type that doesn't honor signed zero).

Whilst modifying match.pd, I also converted some additional folding
transformations from "testing the type" to "testing the value".

The following patch has been tested on x86_64-pc-linux-gnu with
a make bootstrap and make -k check with no new failures.

Ok for mainline?
OK.  Maybe we can at some point record & propagate these
FP value predicates on SSA names just similar to SSA_NAME_RANGE_INFO ...
That's certainly been the hope.  My vision was to have Ranger tackle tracking the special values in the FP space.  But I think Aldy and Andrew are primarily focused on getting Ranger to the point where it subsumes [E]VRP at the moment.

Jeff

Reply via email to