Radically simplify emission of balanced tree for switch statements.
authorMartin Liska <mliska@suse.cz>
Fri, 18 May 2018 08:43:19 +0000 (10:43 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 18 May 2018 08:43:19 +0000 (08:43 +0000)
commiteb63c01f65d475f7f05d1979f66c1c41faa61da9
tree853a097da531ab040ed871970f5fac8cc27d09cf
parentcdc3b88343e3a306c37ddec9f6b546d412c6f3f8
Radically simplify emission of balanced tree for switch statements.

2018-05-18  Martin Liska  <mliska@suse.cz>

* passes.def: Add pass_lower_switch and pass_lower_switch_O0.
* tree-pass.h (make_pass_lower_switch_O0): New function.
* tree-switch-conversion.c (node_has_low_bound): Remove.
(node_has_high_bound): Likewise.
(node_is_bounded): Likewise.
(class pass_lower_switch): Make it a template type and create
two instances.
(pass_lower_switch::execute): Add template argument.
(make_pass_lower_switch): New function.
(make_pass_lower_switch_O0): New function.
(do_jump_if_equal): Remove.
(emit_case_nodes): Simplify to just handle all 3 cases and leave
all the hard work to tree optimization passes.
2018-05-18  Martin Liska  <mliska@suse.cz>

* gcc.dg/tree-ssa/vrp104.c: Adjust dump file that is scanned.
* gcc.dg/tree-prof/update-loopch.c: Likewise.

From-SVN: r260350
gcc/ChangeLog
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
gcc/testsuite/gcc.dg/tree-ssa/vrp104.c
gcc/tree-pass.h
gcc/tree-switch-conversion.c