https://gcc.gnu.org/g:0726f1cde5459ccdbaa6af8c6904276a28d572ba

commit r15-1463-g0726f1cde5459ccdbaa6af8c6904276a28d572ba
Author: Feng Xue <f...@os.amperecomputing.com>
Date:   Sun Jun 16 12:17:26 2024 +0800

    vect: Use one reduction_type local variable
    
    Two local variables were defined to refer same STMT_VINFO_REDUC_TYPE, better
    to keep only one.
    
    2024-06-16 Feng Xue <f...@os.amperecomputing.com>
    
    gcc/
            * tree-vect-loop.cc (vectorizable_reduction): Remove v_reduc_type, 
and
            replace it to another local variable reduction_type.

Diff:
---
 gcc/tree-vect-loop.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index aab408d1019d..27f77ed8b0b6 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7868,10 +7868,10 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
   if (lane_reducing)
     STMT_VINFO_REDUC_VECTYPE_IN (stmt_info) = vectype_in;
 
-  enum vect_reduction_type v_reduc_type = STMT_VINFO_REDUC_TYPE (phi_info);
-  STMT_VINFO_REDUC_TYPE (reduc_info) = v_reduc_type;
+  enum vect_reduction_type reduction_type = STMT_VINFO_REDUC_TYPE (phi_info);
+  STMT_VINFO_REDUC_TYPE (reduc_info) = reduction_type;
   /* If we have a condition reduction, see if we can simplify it further.  */
-  if (v_reduc_type == COND_REDUCTION)
+  if (reduction_type == COND_REDUCTION)
     {
       if (slp_node && SLP_TREE_LANES (slp_node) != 1)
        return false;
@@ -8038,7 +8038,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
 
   STMT_VINFO_REDUC_CODE (reduc_info) = orig_code;
 
-  vect_reduction_type reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
+  reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
   if (reduction_type == TREE_CODE_REDUCTION)
     {
       /* Check whether it's ok to change the order of the computation.

Reply via email to