On 06/22/2018 04:32 AM, Martin Liška wrote:
> On 06/20/2018 05:16 PM, Jeff Law wrote:
>> On 06/20/2018 05:25 AM, Steven Bosscher wrote:
>>> On Tue, Jun 12, 2018 at 10:44 PM, Jeff Law wrote:
>>>> On 06/05/2018 01:15 AM, marxin wrote:
>>>>> + The definition of "much bigger" depends on whether we are
>>>>> + optimizing for size or for speed. If the former, the maximum
>>>>> + ratio range/count = 3, because this was found to be the optimal
>>>>> + ratio for size on i686-pc-linux-gnu, see PR11823. The ratio
>>>>> + 10 is much older, and was probably selected after an extensive
>>>>> + benchmarking investigation on numerous platforms. Or maybe it
>>>>> + just made sense to someone at some point in the history of GCC,
>>>>> + who knows... */
>>>> "much older" is an understatement. I believe the magic "10" pre-dates
>>>> my involvement in GCC. You can find evidence of it as far back as
>>>> gcc-0.9. I doubt it was extensively benchmarked, and even if it was,
>>>> the targets on which it was benchmarked don't reflect modern target
>>>> reality in terms of importance.
>>> When I added this comment
>>> (https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/stmt.c?r1=189284&r2=189285&)
>>> it as an attempt at humor. I should have turned the number into a
>>> PARAM at the time. Maybe that's something Martin could still do now?
>> A PARAM feels like overkill, but I certainly wouldn't object. I'd be
>> happy with that, a const member in the class or even the adjusted
>> constant.
>>
>> jeff
>>
> Hi.
>
> Agree with Jeff, there's a patch that does that.
> Ready after it finishes tests?
>
> Martin
>
>
> 0001-Come-up-with-jump_table-ratio-constants-used-in-jump.patch
>
>
> From 27d7c87720dc464b6ed998bc7344cf2226d5f9ea Mon Sep 17 00:00:00 2001
> From: marxin <mli...@suse.cz>
> Date: Fri, 22 Jun 2018 12:24:13 +0200
> Subject: [PATCH] Come up with jump_table ratio constants used in
> jump_table_cluster.
>
> gcc/ChangeLog:
>
> 2018-06-22 Martin Liska <mli...@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.
OK.
jeff