]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiopt: Remove minmax_replacement [PR101024]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 21 Oct 2025 05:59:51 +0000 (22:59 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Thu, 23 Oct 2025 16:10:03 +0000 (09:10 -0700)
commitf345fc997dc9ed3abf74426e69cd4965cd2ef8aa
treeca3f8d291f3b261beddc51d43745934d20ccfb62
parent22448c7f647d03d8b2727a3e1601aa4078ad87b6
phiopt: Remove minmax_replacement [PR101024]

Now all of the optimizations are done in match from
minmax_replacement. We can now remove minmax_replacement. :)
This keeps around the special case for fp `a CMP b ? a : b` that was
added with r14-2699-g9f8f37f5490076 (PR 88540) and moves it to
match_simplify_replacement.

Bootsrapped and tested on x86_64-linux-gnu.

Note bool-12.c needed to be updated since phiopt1 rejecting the
BIT_AND/BIT_IOR with a cast and not getting MIN/MAX any more.

gcc/ChangeLog:

PR tree-optimization/101024
* tree-ssa-phiopt.cc (match_simplify_replacement): Special
case fp `a CMP b ? a : b` when not creating a min/max.
(strip_bit_not): Remove.
(invert_minmax_code): Remove.
(minmax_replacement): Remove.
(pass_phiopt::execute): Update pass comment.
Don't call minmax_replacement.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/bool-12.c: Update based on when BIT_AND/BIT_IOR
is created and no longer MIN/MAX.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.dg/tree-ssa/bool-12.c
gcc/tree-ssa-phiopt.cc