Make expansion of balanced binary trees of switches on tree level.
authorMartin Liska <mliska@suse.cz>
Tue, 29 Aug 2017 14:12:44 +0000 (16:12 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 29 Aug 2017 14:12:44 +0000 (14:12 +0000)
commit9dc3d6a96167b4c84824be5e472fba4956297033
tree92bc4b549c7dc2a51066020e0e7c1f5c7585c8ef
parent10bcba61fcfb0cd7f7a2ba64f1a14c62e3512eca
Make expansion of balanced binary trees of switches on tree level.

2017-08-29  Martin Liska  <mliska@suse.cz>

* passes.def: Include pass_lower_switch.
* stmt.c (dump_case_nodes): Remove and move to
tree-switch-conversion.
(case_values_threshold): Likewise.
(expand_switch_as_decision_tree_p): Likewise.
(emit_case_decision_tree): Likewise.
(expand_case): Likewise.
(balance_case_nodes): Likewise.
(node_has_low_bound): Likewise.
(node_has_high_bound): Likewise.
(node_is_bounded): Likewise.
(emit_case_nodes): Likewise.
(struct simple_case_node): New struct.
(add_case_node): Remove.
(emit_case_dispatch_table): Use vector instead of case_list.
(reset_out_edges_aux): Remove.
(compute_cases_per_edge): Likewise.
(expand_case): Build list of simple_case_node.
(expand_sjlj_dispatch_table): Use it.
* tree-switch-conversion.c (struct case_node): Moved from
stmt.c and adjusted.
(emit_case_nodes): Likewise.
(node_has_low_bound): Likewise.
(node_has_high_bound): Likewise.
(node_is_bounded): Likewise.
(case_values_threshold): Likewise.
(reset_out_edges_aux): Likewise.
(compute_cases_per_edge): Likewise.
(add_case_node): Likewise.
(dump_case_nodes): Likewise.
(balance_case_nodes): Likewise.
(expand_switch_as_decision_tree_p): Likewise.
(emit_jump): Likewise.
(emit_case_decision_tree): Likewise.
(try_switch_expansion): Likewise.
(do_jump_if_equal): Likewise.
(emit_cmp_and_jump_insns): Likewise.
(fix_phi_operands_for_edge): New function.
(record_phi_operand_mapping): Likewise.
(class pass_lower_switch): New pass.
(pass_lower_switch::execute): New function.
(make_pass_lower_switch): Likewise.
(conditional_probability):
* timevar.def: Add TV_TREE_SWITCH_LOWERING.
* tree-pass.h: Add make_pass_lower_switch.
2017-08-29  Martin Liska  <mliska@suse.cz>

* gcc.dg/tree-prof/update-loopch.c: Scan patterns in
switchlower.
* gcc.dg/tree-ssa/vrp104.c: Likewise.

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