On Fri, 7 Aug 2026, Alfie Richards wrote:

> This is requried specifically for pushing HSSR loads which not only
> define the data loaded, but also do a VDEF to represent the update
> to the HSSR state.
> 
> gcc/ChangeLog:
> 
>       * tree-vect-slp.cc (_slp_tree::push_vec_def): Add exclude_virtuals
>       argument.
>       * tree-vectorizer.h (_slp_tree::push_vec_def): Ditto.
> ---
>  gcc/tree-vect-slp.cc  | 6 ++++--
>  gcc/tree-vectorizer.h | 2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
> index 3d767a5822f..e4a29f85922 100644
> --- a/gcc/tree-vect-slp.cc
> +++ b/gcc/tree-vect-slp.cc
> @@ -163,13 +163,15 @@ _slp_tree::~_slp_tree ()
>  /* Push the single SSA definition in DEF to the vector of vector defs.  */
>  
>  void
> -_slp_tree::push_vec_def (gimple *def)
> +_slp_tree::push_vec_def (gimple *def, bool exclude_virtuals)
>  {

The intent of this "assert" is that if there are multiple defs
you should use the push_vec_def (tree) overload instead.

So NACK, fix the user.

Richard.

>    if (gphi *phi = dyn_cast <gphi *> (def))
>      vec_defs.quick_push (gimple_phi_result (phi));
>    else
>      {
> -      def_operand_p defop = single_ssa_def_operand (def, SSA_OP_ALL_DEFS);
> +      def_operand_p defop = single_ssa_def_operand (def, exclude_virtuals
> +                                                      ? SSA_OP_DEF
> +                                                      : SSA_OP_ALL_DEFS);
>        vec_defs.quick_push (get_def_from_ptr (defop));
>      }
>  }
> diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
> index d15e04de369..01e72b0955b 100644
> --- a/gcc/tree-vectorizer.h
> +++ b/gcc/tree-vectorizer.h
> @@ -322,7 +322,7 @@ struct _slp_tree {
>    _slp_tree ();
>    ~_slp_tree ();
>  
> -  void push_vec_def (gimple *def);
> +  void push_vec_def (gimple *def, bool exclude_virtuals = false);
>    void push_vec_def (tree def) { vec_defs.quick_push (def); }
>  
>    /* Nodes that contain def-stmts of this node statements operands.  */
> 

-- 
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald, Abhinav Puri; (HRB 36809, AG Nuernberg)

Reply via email to