aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-06-28 09:15:55 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-06-28 07:15:55 +0000
commit1aabb71d1331430965794be43f01d0e42e1351e3 (patch)
tree8dca8402123e02905bfcf087e6c8f2397112c5be /gcc/tree-switch-conversion.c
parentdf7c79742af79bc2873ca28a8b3037a088444ca7 (diff)
Come up with jump_table ratio constants used in jump_table_cluster.
2018-06-28 Martin Liska <mliska@suse.cz> * tree-switch-conversion.c (jump_table_cluster::can_be_handled): Use newly introduced constants. * tree-switch-conversion.h (struct jump_table_cluster): Define max_ratio_for_size and max_ratio_for_speed. From-SVN: r262212
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index ddd8cba7b98..b79f2fdb6e6 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -1180,7 +1180,8 @@ jump_table_cluster::can_be_handled (const vec<cluster *> &clusters,
if (start == end)
return true;
- unsigned HOST_WIDE_INT max_ratio = optimize_insn_for_size_p () ? 3 : 8;
+ unsigned HOST_WIDE_INT max_ratio
+ = optimize_insn_for_size_p () ? max_ratio_for_size : max_ratio_for_speed;
unsigned HOST_WIDE_INT range = get_range (clusters[start]->get_low (),
clusters[end]->get_high ());
/* Check overflow. */