]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: Add pattern for `(x | y) & (x & z)`
authorAndrew Pinski <apinski@marvell.com>
Sun, 3 Sep 2023 17:17:29 +0000 (10:17 -0700)
committerAndrew Pinski <apinski@marvell.com>
Tue, 5 Sep 2023 21:14:54 +0000 (14:14 -0700)
commit8e995e84233661a1a246807a66cc84003426b1df
tree303c2d0b4ebcfffdef5359b0ac1991873c413f97
parente6bcf83989478348428c732c11e6c0f1719e9214
MATCH: Add pattern for `(x | y) & (x & z)`

Like the pattern already there for `(x | y) & x`,
this adds a simple pattern to optimize `(x | y) & (x & z)`
to just `x & z`.

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

gcc/ChangeLog:

PR tree-optimization/103536
* match.pd (`(x | y) & (x & z)`,
`(x & y) | (x | z)`): New patterns.

gcc/testsuite/ChangeLog:

PR tree-optimization/103536
* gcc.dg/tree-ssa/andor-6.c: New test.
* gcc.dg/tree-ssa/andor-bool-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/andor-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/andor-bool-1.c [new file with mode: 0644]