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.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

        * 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 | 8 +++-----
 gcc/tree-vect-slp.cc  | 2 +-
 gcc/tree-vectorizer.h | 8 ++------
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 5ddd11b1a74..d29da0e31a3 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -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 = ");
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 4f276771d57..f2ffd1f54e8 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -8190,7 +8190,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 ())
     {
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 905a29142d3..56b3a5ad2a4 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -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
-- 
2.51.0

Reply via email to