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

commit r16-3349-gbd7c238e3c36c872111eb6ffb0e8f75a4a4d2f41
Author: Richard Biener <rguent...@suse.de>
Date:   Fri Aug 22 14:40:12 2025 +0200

    Pass representative of live SLP node to vect_create_epilog_for_reduction
    
    We passed the reduc_info which is close, but the representative is
    more spot on and will not collide with making the reduc_info a
    distinct type.
    
            * tree-vect-loop.cc (vectorizable_live_operation): Pass
            the representative of the PHIs node to
            vect_create_epilog_for_reduction.

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

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d6b5042c08e4..aab375a4d11c 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -10280,16 +10280,17 @@ vectorizable_live_operation (vec_info *vinfo, 
stmt_vec_info stmt_info,
       if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo))
        {
          slp_tree phis_node = slp_node_instance->reduc_phis;
+         stmt_info = SLP_TREE_REPRESENTATIVE (phis_node);
          for (auto exit : get_loop_exit_edges (LOOP_VINFO_LOOP (loop_vinfo)))
            if (exit != LOOP_VINFO_IV_EXIT (loop_vinfo))
              {
-               vect_create_epilog_for_reduction (loop_vinfo, reduc_info,
+               vect_create_epilog_for_reduction (loop_vinfo, stmt_info,
                                                  phis_node, slp_node_instance,
                                                  exit);
                break;
              }
          if (LOOP_VINFO_EARLY_BREAKS_VECT_PEELED (loop_vinfo))
-           vect_create_epilog_for_reduction (loop_vinfo, reduc_info,
+           vect_create_epilog_for_reduction (loop_vinfo, stmt_info,
                                              phis_node, slp_node_instance,
                                              LOOP_VINFO_IV_EXIT (loop_vinfo));
        }

Reply via email to