[0/7] Some more phiopt cleanups and double minmax to match

Message ID 20230424213011.528181-1-apinski@marvell.com
Headers
Series Some more phiopt cleanups and double minmax to match |

Message

Andrew Pinski April 24, 2023, 9:30 p.m. UTC
  The first 3 patches of this patch series is about some more phiopt cleanups
dealing with the worker functions being folded into now the ::execute functions.

The last 4 are allowing diamond based min/max optimization to be done
in match instead of manually in phiopt. Note I have not removed
minmax_replacement yet as there is a few missing patterns from
match still. Those will be implemented in the next couple of weeks.

Andrew Pinski (7):
  PHIOPT: Split out store elimination from phiopt
  PHIOPT: Rename tree_ssa_phiopt_worker to pass_phiopt::execute
  PHIOPT: Move store_elim_worker into pass_cselim::execute
  MIN/MAX should be treated similar as comparisons for trapping
  PHIOPT: Allow MIN/MAX to have up to 2 MIN/MAX expressions for early
    phiopt
  MATCH: Factor out code that for min max detection with constants
  MATCH: Add patterns from phiopt's minmax_replacement

 gcc/fold-const.cc                            |  43 ++
 gcc/fold-const.h                             |   3 +
 gcc/match.pd                                 |  45 +-
 gcc/rtlanal.cc                               |   3 +
 gcc/testsuite/gcc.dg/tree-ssa/minmax-16.c    |  10 +-
 gcc/testsuite/gcc.dg/tree-ssa/split-path-1.c |   3 +-
 gcc/tree-eh.cc                               |   3 +
 gcc/tree-ssa-phiopt.cc                       | 579 ++++++++++---------
 8 files changed, 394 insertions(+), 295 deletions(-)