On Tue, 6 May 2025, andre.simoesdiasvie...@arm.com wrote:

> 
> This removes the non-SLP paths from vectorizable_conversion and in the 
> process eliminates uses of 'ncopies' and removes 
> 'get_initial_def_for_reduction'.  Not done anything about 
> STMT_VINFO_VECTYPE as I'm not sure about its uses in 
> vectorizable_reduction in relation to the vectype_in/out.

That's fine I guess.  Further cleanup is always possible.

-  unsigned int group_size = 1, k;
+  unsigned int group_size, k;

I guess it's clearer to also move the declaration to where the
unconditional init now happens?

-      for (j = 0; j < ncopies; j++)
+      for (j = 0; j < 1; j++)
        {
          tree new_def = copy_ssa_name (def);
          phi = create_phi_node (new_def, exit_bb);
-         if (j)
+         if (0)
            def = gimple_get_lhs (STMT_VINFO_VEC_STMTS (rdef_info)[j]);

guess the next in the series will elide the loop and replace the
other use of 'j'.

@@ -7102,7 +7027,6 @@ vectorize_fold_left_reduction (loop_vec_info 
loop_vinfo,
   tree reduc_var = gimple_phi_result (reduc_def_stmt);

   int vec_num = vec_oprnds0.length ();
-  gcc_assert (vec_num == 1);

not sure if that's the one I complained about earlier.

-      vec_initial_defs.create (ncopies);
-      for (i = 0; i < ncopies; ++i)
+      vec_initial_defs.create (1);
+      for (i = 0; i < 1; ++i)
        vec_initial_defs.quick_push (vec_initial_def);

likewise.

-               the BB of the related stmt is inside this loop.  */
+               the BB of the related stmt is inside this loop.
+               TODO: Do we still need this now that
+               'get_initial_def_for_reduction' has been removed?  */

I think so, there's a "copy" for SLP called 
get_initial_defs_for_reduction, so possibly just change the reference
in the comment.

Richard.



>  gcc/tree-vect-loop.cc  | 127 +++++++----------------------------------
>  gcc/tree-vect-stmts.cc |   4 +-
>  gcc/tree-vectorizer.h  |   5 +-
>  3 files changed, 25 insertions(+), 111 deletions(-)
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Reply via email to