Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-17 Thread Richard Biener
On Tue, 16 Jul 2024, Filip Kastl wrote: > On Wed 2024-07-10 11:34:44, Richard Biener wrote: > > On Mon, 8 Jul 2024, Filip Kastl wrote: > > > > > Hi, > > > > > > I'm replying to Richard and keeping Andrew in cc since your suggestions > > > overlap. > > > > > > > > > On Tue 2024-06-11 14:48:06,

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-16 Thread Filip Kastl
On Wed 2024-07-10 11:34:44, Richard Biener wrote: > On Mon, 8 Jul 2024, Filip Kastl wrote: > > > Hi, > > > > I'm replying to Richard and keeping Andrew in cc since your suggestions > > overlap. > > > > > > On Tue 2024-06-11 14:48:06, Richard Biener wrote: > > > On Thu, 30 May 2024, Filip Kastl

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-12 Thread Richard Biener
On Thu, 11 Jul 2024, Filip Kastl wrote: > > > > > +/* Check that the "exponential index transform" can be applied to > > > > > this switch. > > > > > + > > > > > + See comment of the exp_index_transform function for details about > > > > > this > > > > > + transformation. > > > > > + > > > >

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-11 Thread Filip Kastl
> > > > +/* Check that the "exponential index transform" can be applied to this > > > > switch. > > > > + > > > > + See comment of the exp_index_transform function for details about > > > > this > > > > + transformation. > > > > + > > > > + We want: > > > > + - This form of the switch is

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-10 Thread Richard Biener
On Mon, 8 Jul 2024, Filip Kastl wrote: > Hi, > > I'm replying to Richard and keeping Andrew in cc since your suggestions > overlap. > > > On Tue 2024-06-11 14:48:06, Richard Biener wrote: > > On Thu, 30 May 2024, Filip Kastl wrote: > > > +/* { dg-do compile } */ > > > +/* { dg-options "-O2 -fdu

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-08 Thread Filip Kastl
Hi, I'm replying to Richard and keeping Andrew in cc since your suggestions overlap. On Tue 2024-06-11 14:48:06, Richard Biener wrote: > On Thu, 30 May 2024, Filip Kastl wrote: > > +/* { dg-do compile } */ > > +/* { dg-options "-O2 -fdump-tree-switchconv -march=znver3" } */ > > I think it's bet

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-06-11 Thread Richard Biener
On Thu, 30 May 2024, Filip Kastl wrote: > Hi, > > This patch adds a transformation into the switch conversion pass -- > the "exponential index transform". This transformation can help switch > conversion convert switches it otherwise could not. The transformation is > intended for switches whos

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-05-30 Thread Andrew Pinski
On Thu, May 30, 2024 at 5:09 AM Filip Kastl wrote: > > Hi, > > This patch adds a transformation into the switch conversion pass -- > the "exponential index transform". This transformation can help switch > conversion convert switches it otherwise could not. The transformation is > intended for s

[PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-05-30 Thread Filip Kastl
Hi, This patch adds a transformation into the switch conversion pass -- the "exponential index transform". This transformation can help switch conversion convert switches it otherwise could not. The transformation is intended for switches whose cases are all powers of 2. Here is a more detailed