Add Early VRP
authorKugan Vivekanandarajah <kuganv@linaro.org>
Tue, 20 Sep 2016 23:23:55 +0000 (23:23 +0000)
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>
Tue, 20 Sep 2016 23:23:55 +0000 (23:23 +0000)
commit973625a04b3d9351f2485e37f7d3382af2aed87e
tree47734284907638beb972b85c7a451e86b5532778
parentaa9baacfc94e6147c84d5e0fbbd32dd948e7c8cf
Add Early VRP

gcc/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

* doc/invoke.texi: Document -fdump-tree-evrp.
* passes.def: Define new pass_early_vrp.
* timevar.def: Define new TV_TREE_EARLY_VRP.
* tree-pass.h (make_pass_early_vrp): New.
* tree-ssa-propagate.c: Make replace_uses_in non static.
* tree-ssa-propagate.h: Export replace_uses_in.
* tree-vrp.c (extract_range_for_var_from_comparison_expr): New.
(extract_range_from_assert): Factor out
extract_range_for_var_from_comparison_expr.
(vrp_initialize_lattice): New.
(vrp_initialize): Factor out vrp_initialize_lattice.
(vrp_valueize): Fix it to reject complex value ranges.
(vrp_free_lattice): New.
(evrp_dom_walker::before_dom_children): Likewise.
(evrp_dom_walker::after_dom_children): Likewise.
(evrp_dom_walker::push_value_range): Likewise.
(evrp_dom_walker::pop_value_range): Likewise.
(execute_early_vrp): Likewise.
(execute_vrp): Call vrp_initialize_lattice and
vrp_free_lattice.
(make_pass_early_vrp): New.

gcc/testsuite/ChangeLog:

2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>

* g++.dg/tree-ssa/pr31146-2.C: Run with -fno-tree-evrp as evrp also
does the same transformation.
* g++.dg/warn/pr33738.C: XFAIL as optimization now happens in ccp.
* gcc.dg/tree-ssa/evrp1.c: New test.
* gcc.dg/tree-ssa/evrp2.c: New test.
* gcc.dg/tree-ssa/evrp3.c: New test.
* gcc.dg/tree-ssa/pr20657.c: Check for the pattern in evrp dump.
* gcc.dg/tree-ssa/pr22117.c: Likewise.
* gcc.dg/tree-ssa/pr61839_2.c: Likewise.
* gcc.dg/tree-ssa/pr64130.c: Likewise.
* gcc.dg/tree-ssa/pr37508.c: Change the pattern to be checked as
foling now happens early.
* gcc.dg/tree-ssa/vrp04.c: Likewise.
* gcc.dg/tree-ssa/vrp06.c: Likewise.
* gcc.dg/tree-ssa/vrp16.c: Likewise.
* gcc.dg/tree-ssa/vrp25.c: Likewise.
* gcc.dg/tree-ssa/vrp67.c: Likewise.

From-SVN: r240291
24 files changed:
gcc/ChangeLog
gcc/doc/invoke.texi
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C
gcc/testsuite/g++.dg/warn/pr33738.C
gcc/testsuite/gcc.dg/tree-ssa/evrp1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/evrp2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/evrp3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr20657.c
gcc/testsuite/gcc.dg/tree-ssa/pr22117.c
gcc/testsuite/gcc.dg/tree-ssa/pr37508.c
gcc/testsuite/gcc.dg/tree-ssa/pr61839_2.c
gcc/testsuite/gcc.dg/tree-ssa/pr64130.c
gcc/testsuite/gcc.dg/tree-ssa/vrp04.c
gcc/testsuite/gcc.dg/tree-ssa/vrp06.c
gcc/testsuite/gcc.dg/tree-ssa/vrp16.c
gcc/testsuite/gcc.dg/tree-ssa/vrp25.c
gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
gcc/timevar.def
gcc/tree-pass.h
gcc/tree-ssa-propagate.c
gcc/tree-ssa-propagate.h
gcc/tree-vrp.c