[0/6] Improve PHIOPT match and simplify for diamond shaped bbs

Message ID 20230422220921.452264-1-apinski@marvell.com
Headers
Series Improve PHIOPT match and simplify for diamond shaped bbs |

Message

Andrew Pinski April 22, 2023, 10:09 p.m. UTC
  This set of patches implement match and simplify for diamond shaped bbs.
Right now there are no match-and-simplify patterns which take advantages
of this directly. Though predicates can cause a diamond shaped bb to
show up in phiopt1 even though the BB is empty. This allows
for that and fixes phi-opt-23.c/phi-opt-24.c testcases.


Andrew Pinski (6):
  PHIOPT: Move check on diamond bb to tree_ssa_phiopt_worker from
    minmax_replacement
  PHIOPT: Cleanup tree_ssa_phiopt_worker code
  PHIOPT: Allow other diamond uses when do_hoist_loads is true
  PHIOPT: Factor out some code from match_simplify_replacement
  PHIOPT: Ignore predicates for match-and-simplify phi-opt
  PHIOPT: Add support for diamond shaped bb to
    match_simplify_replacement

 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-23.c    |   4 +-
 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-24.c    |   4 +-
 .../gcc.dg/tree-ssa/ssa-ifcombine-13.c        |   4 +-
 gcc/tree-ssa-phiopt.cc                        | 360 ++++++++++--------
 4 files changed, 218 insertions(+), 154 deletions(-)