Hybrid EVRP and testcases
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 6 Oct 2020 16:53:09 +0000 (12:53 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 6 Oct 2020 17:03:13 +0000 (13:03 -0400)
commitfcae5121154d1c3382b056bcc2c563cedac28e74
tree7f1a992410f82963ee9df115586cf45e39a53583
parent90e88fd376bb9ad6223a1f5ccd803d1bd9539b05
Hybrid EVRP and testcases

Provide a hybrid EVRP pass which uses legacy EVRP and adds additonal
enhancements from the new ranger infrastructure.
A New option is also provided, -fevrp-mode=
And adjust testcases

gcc/ChangeLog:

2020-10-06  Andrew MacLeod  <amacleod@redhat.com>

* flag-types.h (enum evrp_mode): New enumerated type EVRP_MODE_*.
* common.opt (fevrp-mode): New undocumented flag.
* gimple-ssa-evrp.c: Include gimple-range.h
(class rvrp_folder): EVRP folding using ranger exclusively.
(rvrp_folder::rvrp_folder): New.
(rvrp_folder::~rvrp_folder): New.
(rvrp_folder::value_of_expr): New.  Use rangers value_of_expr.
(rvrp_folder::value_on_edge): New.  Use rangers value_on_edge.
(rvrp_folder::value_of_Stmt): New.  Use rangers value_of_stmt.
(rvrp_folder::fold_stmt): New.  Call the simplifier.
(class hybrid_folder): EVRP folding using both engines.
(hybrid_folder::hybrid_folder): New.
(hybrid_folder::~hybrid_folder): New.
(hybrid_folder::fold_stmt): New.  Simplify with one engne, then the
other.
(hybrid_folder::value_of_expr): New.  Use both value routines.
(hybrid_folder::value_on_edge): New.  Use both value routines.
(hybrid_folder::value_of_stmt): New.  Use both value routines.
(hybrid_folder::choose_value): New.  Choose between range_analzyer and
rangers values.
(execute_early_vrp): Choose a folder based on flag_evrp_mode.
* vr-values.c (simplify_using_ranges::fold_cond): Try range_of_stmt
first to see if it returns a value.
(simplify_using_ranges::simplify_switch_using_ranges): Return true if
any changes were made to the switch.

gcc/testsuite/ChangeLog:

2020-10-06  Andrew MacLeod  <amacleod@redhat.com>

* gcc.dg/pr81192.c: Disable EVRP pass.
* gcc.dg/tree-ssa/pr77445-2.c: Ditto.
* gcc.dg/tree-ssa/ssa-dom-thread-6.c: Adjust.
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Ditto.
gcc/common.opt
gcc/flag-types.h
gcc/gimple-ssa-evrp.c
gcc/testsuite/gcc.dg/pr81192.c
gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
gcc/vr-values.c