diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-11-15 23:20:42 -0800 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-11-16 11:10:49 -0800 |
commit | b085fc9965b7d1e99725892587682822068f2baa (patch) | |
tree | c6213c645f86497e3030ad5b07252b13c68ae979 /contrib/clang-format | |
parent | 5eadc673366c68a62264c55a570cbdfca96bbbaa (diff) | |
download | gcc-b085fc9965b7d1e99725892587682822068f2baa.zip gcc-b085fc9965b7d1e99725892587682822068f2baa.tar.gz gcc-b085fc9965b7d1e99725892587682822068f2baa.tar.bz2 |
match: Optimize `max(a,b) == 0` to `(a|b) == 0` for unsigned [PR115275]
For unsigned types, you can optimize `max<a,b> == 0` into
`(a|b) == 0` (that is both have to be zero). A similar thing happens for `!= 0`.
This optimization fixes the missed optimization (g++.dg/tree-ssa/pr115275.C)
that was reported exposed by adding phiprop early.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/115275
gcc/ChangeLog:
* match.pd (umax(a,b) ==/!= 0): New pattern.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/pr115275.C: New test.
* gcc.dg/tree-ssa/max_eqne-1.c: New test.
* gcc.dg/tree-ssa/max_eqne-2.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'contrib/clang-format')
0 files changed, 0 insertions, 0 deletions