On Fri, May 15, 2026 at 4:58 PM Robin Dapp <[email protected]> wrote:
>
> Hi,
>
> Right now, we even use a grouped gather/scatter for single pieces, i.e.
> when there is no stride involved.  This patch guards grouped gather
> with >= 2 pieces.
>
> Bootstrapped and regtested on x86, power10, and aarch64.
> Regtested on riscv64.

OK

> Regards
>  Robin
>
> gcc/ChangeLog:
>
>         * tree-vect-stmts.cc (vect_use_grouped_gather): Only use when
>         there are at least two pieces.
> ---
>  gcc/tree-vect-stmts.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
> index da87b329715..50a0acb4214 100644
> --- a/gcc/tree-vect-stmts.cc
> +++ b/gcc/tree-vect-stmts.cc
> @@ -1749,7 +1749,7 @@ vect_use_grouped_gather (dr_vec_info *dr_info, tree 
> vectype,
>    tree tmp;
>    unsigned int pieces;
>    if (!can_div_trunc_p (TYPE_VECTOR_SUBPARTS (vectype), nelts, &pieces)
> -      || !pieces)
> +      || pieces <= 1)
>      return false;
>
>    *pun_vectype = vector_vector_composition_type (vectype, pieces, &tmp, 
> true);
> --
> 2.53.0

Reply via email to