MATCH: Add `a == b | a cmp b` and `a != b & a cmp b` simplifications
commitac0e0966ebf08c454d53042a649403e2880ccbc1
authorAndrew Pinski <apinski@marvell.com>
Sun, 30 Jul 2023 04:52:31 +0000 (29 21:52 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 31 Jul 2023 17:12:07 +0000 (31 10:12 -0700)
tree501cade81f7ba2186f27213341658a42af0a8498
parent0258b73680e21fd96290af961c80966ac6b3cc68
MATCH: Add `a == b | a cmp b` and `a != b & a cmp b` simplifications

Even though these are done by combine_comparisons, we can add them to match
to allow simplifcations during match rather than just during reassoc/ifcombine.

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

gcc/ChangeLog:

PR tree-optimization/106164
* match.pd (`a != b & a <= b`, `a != b & a >= b`,
`a == b | a < b`, `a == b | a > b`): Handle these cases
too.

gcc/testsuite/ChangeLog:

PR tree-optimization/106164
* gcc.dg/tree-ssa/cmpbit-2.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/cmpbit-2.c [new file with mode: 0644]