]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove LOOP_VINFO_SLP_UNROLLING_FACTOR
authorRichard Biener <rguenther@suse.de>
Thu, 23 Oct 2025 09:13:09 +0000 (11:13 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 23 Oct 2025 10:57:21 +0000 (12:57 +0200)
The following removes LOOP_VINFO_SLP_UNROLLING_FACTOR in favor of
using LOOP_VINFO_VECT_FACTOR directly now that there's no difference
between the two possible.

* tree-vectorizer.h (_loop_vec_info::slp_unrolling_factor): Remove.
(LOOP_VINFO_SLP_UNROLLING_FACTOR): Likewise.
* tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Adjust.
(vect_analyze_loop_2): Likewise.
* tree-vect-slp.cc (vect_make_slp_decision): Set
LOOP_VINFO_VECT_FACTOR directly.

gcc/tree-vect-loop.cc
gcc/tree-vect-slp.cc
gcc/tree-vectorizer.h

index d44a77d85c3f68e1a08f04de6bc9aec6e5e6edcf..a98c06dd06645b2cc93e1ef2a883be812503de9e 100644 (file)
@@ -738,7 +738,6 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *shared)
     nonlinear_iv (false),
     ivexpr_map (NULL),
     scan_map (NULL),
-    slp_unrolling_factor (1),
     inner_loop_cost_factor (param_vect_inner_loop_cost_factor),
     vectorizable (false),
     can_use_partial_vectors_p (param_vect_partial_vector_usage != 0),
@@ -2236,16 +2235,15 @@ start_over:
   if (!ok)
     return ok;
 
-  /* If there are any SLP instances mark them as pure_slp.  */
+  /* If there are any SLP instances mark them as pure_slp and compute
+     the overall vectorization factor.  */
   if (!vect_make_slp_decision (loop_vinfo))
     return opt_result::failure_at (vect_location, "no stmts to vectorize.\n");
 
   if (dump_enabled_p ())
     dump_printf_loc (MSG_NOTE, vect_location, "Loop contains only SLP stmts\n");
 
-  /* Determine the vectorization factor from the SLP decision.  */
-  LOOP_VINFO_VECT_FACTOR (loop_vinfo)
-    = LOOP_VINFO_SLP_UNROLLING_FACTOR (loop_vinfo);
+  /* Dump the vectorization factor from the SLP decision.  */
   if (dump_enabled_p ())
     {
       dump_printf_loc (MSG_NOTE, vect_location, "vectorization factor = ");
index 9698709f5671971c35a50a16a258874beb44514a..3c760b495af2357c00a9ccec3b3e503da95ae91c 100644 (file)
@@ -8171,7 +8171,7 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
        decided_to_slp++;
     }
 
-  LOOP_VINFO_SLP_UNROLLING_FACTOR (loop_vinfo) = unrolling_factor;
+  LOOP_VINFO_VECT_FACTOR (loop_vinfo) = unrolling_factor;
 
   if (decided_to_slp && dump_enabled_p ())
     {
index 905a29142d3eb8077ab9fb29b3cceb04834848fe..56b3a5ad2a460861a6579c608bd1367f7576ddb3 100644 (file)
@@ -945,7 +945,8 @@ public:
      used.  */
   poly_uint64 versioning_threshold;
 
-  /* Unrolling factor  */
+  /* Unrolling factor.  In case of suitable super-word parallelism
+     it can be that no unrolling is needed, and thus this is 1.  */
   poly_uint64 vectorization_factor;
 
   /* If this loop is an epilogue loop whose main loop can be skipped,
@@ -1090,10 +1091,6 @@ public:
      rhs of the store of the initializer.  */
   hash_map<tree, tree> *scan_map;
 
-  /* The unrolling factor needed to SLP the loop. In case of that pure SLP is
-     applied to the loop, i.e., no unrolling is needed, this is 1.  */
-  poly_uint64 slp_unrolling_factor;
-
   /* The factor used to over weight those statements in an inner loop
      relative to the loop being vectorized.  */
   unsigned int inner_loop_cost_factor;
@@ -1294,7 +1291,6 @@ public:
 #define LOOP_VINFO_USER_UNROLL(L)          (L)->user_unroll
 #define LOOP_VINFO_GROUPED_STORES(L)       (L)->grouped_stores
 #define LOOP_VINFO_SLP_INSTANCES(L)        (L)->slp_instances
-#define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor
 #define LOOP_VINFO_REDUCTIONS(L)           (L)->reductions
 #define LOOP_VINFO_PEELING_FOR_GAPS(L)     (L)->peeling_for_gaps
 #define LOOP_VINFO_PEELING_FOR_NITER(L)    (L)->peeling_for_niter