]> gcc.gnu.org Git - gcc.git/commit
PHIOPT: Ignore predicates for match-and-simplify phi-opt
authorAndrew Pinski <apinski@marvell.com>
Sun, 9 Apr 2023 22:47:50 +0000 (22:47 +0000)
committerAndrew Pinski <apinski@marvell.com>
Mon, 24 Apr 2023 15:50:07 +0000 (08:50 -0700)
commita2339e0fe9dbefdeca49a8105c7a547231c02d34
tree98b15e9e775762052e5eba88b6bace06dc4022bb
parent245753249c595af95a811ddb0fe572d93a5dae72
PHIOPT: Ignore predicates for match-and-simplify phi-opt

This fixes a missed optimization where early phi-opt would
not work when there was predicates. The easiest fix is
to change empty_bb_or_one_feeding_into_p to ignore those
statements while checking for only feeding statement.

Note phi-opt-23.c and phi-opt-24.c still fail as we don't handle
diamond form in match_and_simplify phiopt yet.

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

gcc/ChangeLog:

* tree-ssa-phiopt.cc (empty_bb_or_one_feeding_into_p):
Instead of calling last_and_only_stmt, look for the last statement
manually.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/ssa-ifcombine-13.c: Add -fno-ssa-phiopt.
gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-13.c
gcc/tree-ssa-phiopt.cc
This page took 0.079242 seconds and 6 git commands to generate.