[gcc r16-7863] Do not mark stmts PURE_SLP for loop vectorization

Richard Biener rguenth@gcc.gnu.org
Tue Mar 3 12:04:46 GMT 2026


https://gcc.gnu.org/g:1ca2e5dfa51ab319858ea60fd18367664624b460

commit r16-7863-g1ca2e5dfa51ab319858ea60fd18367664624b460
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Mar 2 15:08:03 2026 +0100

    Do not mark stmts PURE_SLP for loop vectorization
    
    Remove this legacy marking from loop vectorization code and adjust
    few leftovers from the removal of hybrid SLP support.
    
            * tree-vect-slp.cc (vect_make_slp_decision): Do not call
            vect_mark_slp_stmts.
            * tree-vect-data-refs.cc (vect_enhance_data_refs_alignment):
            We are always doing SLP.
            (vect_supportable_dr_alignment): Likewise.
            * tree-vect-loop.cc (vect_analyze_loop_2): No need to reset
            STMT_SLP_TYPE.

Diff:
---
 gcc/tree-vect-data-refs.cc |  4 +---
 gcc/tree-vect-loop.cc      | 11 +----------
 gcc/tree-vect-slp.cc       |  5 -----
 3 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index 25eb2b07c600..ae556d85c7f9 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -2536,8 +2536,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
               if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
 		{
 		  unsigned group_size = 1;
-		  if (STMT_SLP_TYPE (stmt_info)
-		      && STMT_VINFO_GROUPED_ACCESS (stmt_info))
+		  if (STMT_VINFO_GROUPED_ACCESS (stmt_info))
 		    group_size = DR_GROUP_SIZE (stmt_info);
 		  nscalars = vf * group_size;
 		}
@@ -6896,7 +6895,6 @@ vect_supportable_dr_alignment (vec_info *vinfo, dr_vec_info *dr_info,
 	  /* If we are doing SLP then the accesses need not have the
 	     same alignment, instead it depends on the SLP group size.  */
 	  if (loop_vinfo
-	      && STMT_SLP_TYPE (stmt_info)
 	      && STMT_VINFO_GROUPED_ACCESS (stmt_info)
 	      && !multiple_p (LOOP_VINFO_VECT_FACTOR (loop_vinfo)
 			      * (DR_GROUP_SIZE
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 7d3151128e7a..670a03ea06b3 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -2678,7 +2678,7 @@ again:
   FOR_EACH_VEC_ELT (LOOP_VINFO_SLP_INSTANCES (loop_vinfo), j, instance)
     vect_free_slp_instance (instance);
   LOOP_VINFO_SLP_INSTANCES (loop_vinfo).release ();
-  /* Reset SLP type to loop_vect on all stmts.  */
+  /* Reset altered state on stmts.  */
   for (i = 0; i < LOOP_VINFO_LOOP (loop_vinfo)->num_nodes; ++i)
     {
       basic_block bb = LOOP_VINFO_BBS (loop_vinfo)[i];
@@ -2686,7 +2686,6 @@ again:
 	   !gsi_end_p (si); gsi_next (&si))
 	{
 	  stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (gsi_stmt (si));
-	  STMT_SLP_TYPE (stmt_info) = not_vect;
 	  if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def
 	      || STMT_VINFO_DEF_TYPE (stmt_info) == vect_double_reduction_def)
 	    {
@@ -2705,20 +2704,12 @@ again:
 	  if (is_gimple_debug (gsi_stmt (si)))
 	    continue;
 	  stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (gsi_stmt (si));
-	  STMT_SLP_TYPE (stmt_info) = not_vect;
 	  if (STMT_VINFO_IN_PATTERN_P (stmt_info))
 	    {
 	      stmt_vec_info pattern_stmt_info
 		= STMT_VINFO_RELATED_STMT (stmt_info);
 	      if (STMT_VINFO_SLP_VECT_ONLY_PATTERN (pattern_stmt_info))
 		STMT_VINFO_IN_PATTERN_P (stmt_info) = false;
-
-	      gimple *pattern_def_seq = STMT_VINFO_PATTERN_DEF_SEQ (stmt_info);
-	      STMT_SLP_TYPE (pattern_stmt_info) = not_vect;
-	      for (gimple_stmt_iterator pi = gsi_start (pattern_def_seq);
-		   !gsi_end_p (pi); gsi_next (&pi))
-		STMT_SLP_TYPE (loop_vinfo->lookup_stmt (gsi_stmt (pi)))
-		  = not_vect;
 	    }
 	}
     }
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index c932e8d5cba2..b6e1e440116c 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -8413,11 +8413,6 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
 	 for some rational X, so they must have a common multiple.  */
       vect_update_slp_vf_for_node (root, unrolling_factor, visited);
 
-      /* Mark all the stmts that belong to INSTANCE as PURE_SLP stmts.  Later we
-	 call vect_detect_hybrid_slp () to find stmts that need hybrid SLP and
-	 loop-based vectorization.  Such stmts will be marked as HYBRID.  */
-      vect_mark_slp_stmts (loop_vinfo, root);
-
       /* If all instances ended up with vector(1) T roots make sure to
 	 not vectorize.  RVV for example relies on loop vectorization
 	 when some instances are essentially kept scalar.  See PR121048.  */


More information about the Gcc-cvs mailing list