diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-08-25 03:57:53 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-08-28 13:47:55 +0000 |
commit | c3669bb677bdffeaaee0d88ab4104cc6806643fd (patch) | |
tree | 2ff685a33b1211de41f7557719eddcffde9db635 /contrib/unused_functions.py | |
parent | cbde03abe5dbba13b992a3b610efe43aefc0e234 (diff) | |
download | gcc-c3669bb677bdffeaaee0d88ab4104cc6806643fd.zip gcc-c3669bb677bdffeaaee0d88ab4104cc6806643fd.tar.gz gcc-c3669bb677bdffeaaee0d88ab4104cc6806643fd.tar.bz2 |
MATCH: Move `(X & ~Y) | (~X & Y)` over to use bitwise_inverted_equal_p
This moves the pattern `(X & ~Y) | (~X & Y)` to use bitwise_inverted_equal_p
so we can simplify earlier the case where X and Y are defined by comparisons.
We were able to optimize to (!X)^(!Y) in the end due to the pattern added in
r14-3110-g7fb65f102851248bafa0815 and the older pattern r13-4620-g4d9db4bdd458 .
But folding it earlier is better.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Note pr87009.c now gets `return x ^ s; in one case where the test had been expecting
`return s ^ x;` both are valid and would be expectly the same; just we now chose a slightly
different order of simplification which causes the order of the operands to be different.
gcc/ChangeLog:
* match.pd (`(X & ~Y) | (~X & Y)`): Use bitwise_inverted_equal_p
instead of specifically checking for ~X.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/cmpbit-3.c: New test.
* gcc.dg/pr87009.c: Update test.
Diffstat (limited to 'contrib/unused_functions.py')
0 files changed, 0 insertions, 0 deletions