This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix clustering algorithm in switch expansion.
- From: Jeff Law <law at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Jun 2018 10:20:43 -0600
- Subject: Re: [PATCH] Fix clustering algorithm in switch expansion.
- References: <cc6085fb-866f-f64a-02f5-61cc46cd44c4@suse.cz>
On 06/22/2018 03:23 AM, Martin Liška wrote:
> Hi.
>
> For correctness of clustering algorithm:
> https://www.semanticscholar.org/paper/Short-Communication%3A-Correction-to-'Producing-Good-Kannan-Proebsting/311091fb9fb9d38f7b76e768a603c02acc799fe0
>
> one needs to allow single case clusters as possible. Note that we never
> end with a jump table, or a bit test handling just a single case.
> I also add tests for that catch that.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?
> Martin
>
> gcc/ChangeLog:
>
> 2018-06-21 Martin Liska <mliska@suse.cz>
>
> * tree-switch-conversion.c (jump_table_cluster::find_jump_tables):
> Add new checking assert to catch invalid state.
> (jump_table_cluster::can_be_handled): Handle single case
> clusters.
> (jump_table_cluster::is_beneficial): Bail out for such case.
> (bit_test_cluster::find_bit_tests):
> Add new checking assert to catch invalid state.
> (bit_test_cluster::can_be_handled): Handle single case
> clusters.
> (bit_test_cluster::is_beneficial): Bail out for such case.
> (switch_decision_tree::analyze_switch_statement):
> Fix comment.
>
> gcc/testsuite/ChangeLog:
>
> 2018-06-21 Martin Liska <mliska@suse.cz>
>
> * gcc.dg/tree-ssa/switch-1.c: New test.
OK.
jeff