]> git.ipfire.org Git - thirdparty/gcc.git/commit
Improve profile handling in switch lowering.
authorMartin Liska <mliska@suse.cz>
Mon, 24 Jan 2022 14:45:38 +0000 (15:45 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 30 Nov 2022 13:03:43 +0000 (14:03 +0100)
commit4fa25a7eb322f0a003c1eb15680c71ece345e01e
tree52b4d065f5870abbf4215efc517ef2aacb84cbb0
parentb628cad9e093f7a33042fb9dd647f183394eefae
Improve profile handling in switch lowering.

PR tree-optimization/101301
PR tree-optimization/103680

gcc/ChangeLog:

* tree-switch-conversion.cc (bit_test_cluster::emit):
Handle correctly remaining probability.
(switch_decision_tree::try_switch_expansion): Fix BB's count
where a cluster expansion happens.
(switch_decision_tree::emit_cmp_and_jump_insns): Fill up also
BB count.
(switch_decision_tree::do_jump_if_equal): Likewise.
(switch_decision_tree::emit_case_nodes): Handle special case
for BT expansion which can also fallback to a default BB.
* tree-switch-conversion.h (cluster::cluster): Add
m_default_prob probability.
gcc/tree-switch-conversion.cc
gcc/tree-switch-conversion.h