]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-switch-conversion: don't apply switch size limit on jump tables
authorMark Wielaard <mark@klomp.org>
Sun, 5 Jan 2025 17:00:36 +0000 (18:00 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 6 Jan 2025 09:49:53 +0000 (10:49 +0100)
commit 56946c801a7c ("gimple: Add limit after which slower switchlower
algs are used [PR117091] [PR117352]") introduced a limit on the number
of cases of a switch. It also bails out on finding jump tables if the
switch is too large. This introduces a compile time regression during
bootstrap. A riscv bootstrap takes hours longer. Particularly
insn-attrtab.cc will take hours instead of minutes. Fix this by not
applying the switch size limit on jump tables.

An alternative would be to implement greedy switch clustering for jump
tables as is done for switch bitmap clustering.

gcc/ChangeLog:

PR tree-optimization/118032
* tree-switch-conversion.cc (jump_table_cluster::find_jump_tables):
Remove param_switch_lower_slow_alg_max_cases check.

gcc/tree-switch-conversion.cc

index 432970597c97030d4bf2963d66e323a812978364..39a8a893eddeeb70a4f5a8ed7869874c46f77360 100644 (file)
@@ -1643,10 +1643,6 @@ jump_table_cluster::find_jump_tables (vec<cluster *> &clusters)
 
   unsigned l = clusters.length ();
 
-  /* Note: l + 1 is the number of cases of the switch.  */
-  if (l + 1 > (unsigned) param_switch_lower_slow_alg_max_cases)
-    return clusters.copy ();
-
   auto_vec<min_cluster_item> min;
   min.reserve (l + 1);