On 1/10/25 2:43 PM, Andrew MacLeod wrote:
This should have been done a while ago.
Funny I said kind of the same thing when I did the DOM variant for
integral types a little while back.
The call to simplify MIN and MAX was guarded by a check for INTEGRAL, so
I removed that as the code was already generalized to work with any type.
And no attempt was being made to pass in a relation... so I query for a
relation between op0 and op1, and pass it to fold_range. And then all
the right things happen.
I see Jeff fixed PR 110199 in DOM. I copied the tests from that and
created the same tests to test that
a) EVRP is removing all the MIN_EXPR and MAX_EXPRs
b) Added a float version of the tests with -ffast-math to show its
also working with floats.
Bootstraps on x86_64-pc-linux-gnu with no regressions. OK for trunk?
OK.
Andrew
PS. The same patch will not work on gcc-14, but the code could be
ported if we wanted to. Presumably DOM is getting the integral
versions, so it would only be floats we would be new to handling.
I don't think it's worth backporting to gcc-13 or gcc-14. It's a pretty
minor missed optimization in my mind.
jeff