public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2278] vect: Pass reduc_info to get_initial_def_for_reduction
@ 2021-07-13  9:18 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2021-07-13  9:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:bd5a69191f023b9bc2a1f83c5f7d5e591c333b9a

commit r12-2278-gbd5a69191f023b9bc2a1f83c5f7d5e591c333b9a
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Jul 13 10:17:40 2021 +0100

    vect: Pass reduc_info to get_initial_def_for_reduction
    
    Similarly to the previous patch, this one passes the reduc_info
    to get_initial_def_for_reduction, rather than a stmt_vec_info that
    lacks the metadata.  This again becomes useful later.
    
    gcc/
            * tree-vect-loop.c (get_initial_def_for_reduction): Take the
            reduc_info instead of the original stmt_vec_info.
            (vect_transform_cycle_phi): Update accordingly.

Diff:
---
 gcc/tree-vect-loop.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 565c2859477..a67036f92e0 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4625,7 +4625,7 @@ vect_model_reduction_cost (loop_vec_info loop_vinfo,
 /* Function get_initial_def_for_reduction
 
    Input:
-   STMT_VINFO - a stmt that performs a reduction operation in the loop.
+   REDUC_INFO - the info_for_reduction
    INIT_VAL - the initial value of the reduction variable
 
    Output:
@@ -4667,7 +4667,7 @@ vect_model_reduction_cost (loop_vec_info loop_vinfo,
 
 static tree
 get_initial_def_for_reduction (loop_vec_info loop_vinfo,
-			       stmt_vec_info stmt_vinfo,
+			       stmt_vec_info reduc_info,
 			       enum tree_code code, tree init_val,
                                tree *adjustment_def)
 {
@@ -4685,8 +4685,8 @@ get_initial_def_for_reduction (loop_vec_info loop_vinfo,
   gcc_assert (POINTER_TYPE_P (scalar_type) || INTEGRAL_TYPE_P (scalar_type)
 	      || SCALAR_FLOAT_TYPE_P (scalar_type));
 
-  gcc_assert (nested_in_vect_loop_p (loop, stmt_vinfo)
-	      || loop == (gimple_bb (stmt_vinfo->stmt))->loop_father);
+  gcc_assert (nested_in_vect_loop_p (loop, reduc_info)
+	      || loop == (gimple_bb (reduc_info->stmt))->loop_father);
 
   /* ADJUSTMENT_DEF is NULL when called from
      vect_create_epilog_for_reduction to vectorize double reduction.  */
@@ -7556,7 +7556,7 @@ vect_transform_cycle_phi (loop_vec_info loop_vinfo,
 	  if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_double_reduction_def)
 	    adjustment_defp = NULL;
 	  vec_initial_def
-	    = get_initial_def_for_reduction (loop_vinfo, reduc_stmt_info, code,
+	    = get_initial_def_for_reduction (loop_vinfo, reduc_info, code,
 					     initial_def, adjustment_defp);
 	  STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info) = adjustment_def;
 	  vec_initial_defs.create (ncopies);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-13  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  9:18 [gcc r12-2278] vect: Pass reduc_info to get_initial_def_for_reduction Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).