]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: [PR111348] add missing :c to cmp in the `(a CMP b) ? minmax<a, c> : minmax...
authorAndrew Pinski <apinski@marvell.com>
Mon, 11 Sep 2023 15:05:10 +0000 (08:05 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 11 Sep 2023 20:40:46 +0000 (13:40 -0700)
commit8fdf712a38422952bbcde7e22eabcf821e6676b3
tree158137eb91c75efa3da7bf63c57e0653f7dcc629
parent048927ed8561ca994ad853fe85ccf8c2ca07a8fe
MATCH: [PR111348] add missing :c to cmp in the `(a CMP b) ? minmax<a, c> : minmax<b, c>` pattern

When I added this pattern in r14-337-gc43819a9b4cd, I had missed the :c on the cmp
part of the pattern meaning there might be some missing optimizations happening.
The testcase shows an example of the missed optmization.

Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

PR tree-optimization/111348

gcc/ChangeLog:

* match.pd (`(a CMP b) ? minmax<a, c> : minmax<b, c>`): Add :c on
the cmp part of the pattern.

gcc/testsuite/ChangeLog:

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