]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR 95923: More (boolean) bitop simplifications in match.pd
authorAndrew Pinski <apinski@marvell.com>
Sun, 16 Jul 2023 22:31:59 +0000 (22:31 +0000)
committerAndrew Pinski <apinski@marvell.com>
Mon, 17 Jul 2023 06:43:19 +0000 (06:43 +0000)
commit0407ae8a7732d90622a65ddf1798c9d51d450e9d
tree420e1ec558bcfb08cb751b5534c8df689b512613
parent5ae1f391934a853a36f4bcc5a849c7900bec43b0
PR 95923: More (boolean) bitop simplifications in match.pd

This adds the boolean version of some of the simplifications
that were added with r8-4395-ge268a77b59cb78.

That are the following:
(a | b) & (a == b) --> a & b
a | (a == b)       --> a | (b ^ 1)
(a & b) | (a == b) --> a == b

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/95923
* match.pd ((a|b)&(a==b),a|(a==b),(a&b)|(a==b)): New transformation.

gcc/testsuite/ChangeLog:

PR tree-optimization/95923
* gcc.dg/tree-ssa/bitops-2.c: New test.
* gcc.dg/tree-ssa/bool-checks-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/bitops-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/bool-checks-1.c [new file with mode: 0644]