]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: Add `~MAX(~X, Y)` pattern: [PR96694]
authorAndrew Pinski <apinski@marvell.com>
Sun, 3 Sep 2023 18:37:51 +0000 (18:37 +0000)
committerAndrew Pinski <apinski@marvell.com>
Tue, 5 Sep 2023 20:56:49 +0000 (20:56 +0000)
commit244d1321340116b7780e78096356f69662fd0e18
tree484082f3c1518a654b2acc6758b350473d1a560e
parentb34f373635635fa331d2803d9232b3cfd4fd4fd1
MATCH: Add `~MAX(~X, Y)` pattern: [PR96694]

This adds `~MAX(~X, Y)` and `~MIN(~X, Y)` patterns
that are like the `~(~a & b)` and `~(~a | b)` patterns
and allows to reduce the number of ~ by 1.

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

PR tree-optimization/96694

gcc/ChangeLog:

* match.pd (`~MAX(~X, Y)`, `~MIN(~X, Y)`): New patterns.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/minmax-24.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/minmax-24.c [new file with mode: 0644]