On Wed, 27 Aug 2025, Jakub Jelinek wrote:
> On Wed, Aug 27, 2025 at 03:50:26PM +0200, Richard Biener wrote:
> > Ah, thanks for the write-up how to compute the number of uses.
> >
> > I'll test the following.
> > --- a/gcc/tree-vect-patterns.cc
> > +++ b/gcc/tree-vect-patterns.cc
> > @@ -4303,6 +4
On Wed, Aug 27, 2025 at 03:50:26PM +0200, Richard Biener wrote:
> Ah, thanks for the write-up how to compute the number of uses.
>
> I'll test the following.
> --- a/gcc/tree-vect-patterns.cc
> +++ b/gcc/tree-vect-patterns.cc
> @@ -4303,6 +4303,8 @@ vect_synth_mult_by_constant (vec_info *vinfo, tr
break;
> default:
> break;
> }
> if (variant == add_variant)
> op_uses++;
> if (op_uses > 1)
> return NULL;
> }
> This basically counts how many times the later code will use
> the op operand (with synth
On Wed, Aug 27, 2025 at 02:48:33PM +0200, Richard Biener wrote:
> I don't understand how synth-mult works, but it does introduce
> multiple uses of a reduction variable which will ultimatively
> fail vectorization (or ICE with a pending change). So avoid
> applying the pattern. I've tried to do s
I don't understand how synth-mult works, but it does introduce
multiple uses of a reduction variable which will ultimatively
fail vectorization (or ICE with a pending change). So avoid
applying the pattern. I've tried to do so selectively, possibly
preserving pattern-matching x * 4 as x << 2.
So