diff options
author | Andi Kleen <ak@gcc.gnu.org> | 2024-10-16 14:07:18 -0700 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2024-10-29 15:08:11 -0700 |
commit | a4e2b13888267f2581ac03f076aa0d32cd045adb (patch) | |
tree | 16bd2df2b6c166c2e53d56d7a270c447918155df /gcc/fortran/error.cc | |
parent | 06bc3a734e88908cad1d3bf547a722b3f9597a0d (diff) | |
download | gcc-a4e2b13888267f2581ac03f076aa0d32cd045adb.zip gcc-a4e2b13888267f2581ac03f076aa0d32cd045adb.tar.gz gcc-a4e2b13888267f2581ac03f076aa0d32cd045adb.tar.bz2 |
Only do switch bit test clustering when multiple labels point to same bb
The bit cluster code generation strategy is only beneficial when
multiple case labels point to the same code. Do a quick check if
that is the case before trying to cluster.
This fixes the switch part of PR117091 where all case labels are unique
however it doesn't address the performance problems for non unique
cases.
gcc/ChangeLog:
PR middle-end/117091
* gimple-if-to-switch.cc (if_chain::is_beneficial): Update
find_bit_test call.
* tree-switch-conversion.cc (bit_test_cluster::find_bit_tests):
Get max_c argument and bail out early if all case labels are
unique.
(switch_decision_tree::compute_cases_per_edge): Record number of
targets per label and return.
(switch_decision_tree::analyze_switch_statement): ... pass to
find_bit_tests.
* tree-switch-conversion.h: Update prototypes.
Diffstat (limited to 'gcc/fortran/error.cc')
0 files changed, 0 insertions, 0 deletions