The following removes REDUC_GROUP_* from the public vectorizer
interface and privatizes REDUC_GROUP_FIRST_ELEMENT which is now
only temporarily set during SLP discovery.

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

        * tree-vectorizer.h (REDUC_GROUP_FIRST_ELEMENT,
        REDUC_GROUP_NEXT_ELEMENT, REDUC_GROUP_SIZE): Remove.
        * tree-vect-slp.cc (REDUC_GROUP_FIRST_ELEMENT): Re-instantiate
        here.
---
 gcc/tree-vect-slp.cc  | 3 +++
 gcc/tree-vectorizer.h | 9 +--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index c5a2fe82394..13a2995592b 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -53,6 +53,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "sreal.h"
 #include "predict.h"
 
+#define REDUC_GROUP_FIRST_ELEMENT(S) \
+  (gcc_checking_assert (!(S)->dr_aux.dr), (S)->first_element)
+
 static bool vect_transform_slp_perm_load_1 (vec_info *, slp_tree,
                                            load_permutation_t &,
                                            const vec<tree> &,
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 11f3dc8db0a..654c012e2ba 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1538,7 +1538,7 @@ public:
   /*  Whether the stmt is SLPed, loop-based vectorized, or both.  */
   enum slp_vect_type slp_type;
 
-  /* Interleaving and reduction chains info.  */
+  /* Interleaving chains info.  */
   /* First element in the group.  */
   stmt_vec_info first_element;
   /* Pointer to the next element in the group.  */
@@ -1711,13 +1711,6 @@ struct gather_scatter_info {
 #define DR_GROUP_GAP(S) \
   (gcc_checking_assert ((S)->dr_aux.dr), (S)->gap)
 
-#define REDUC_GROUP_FIRST_ELEMENT(S) \
-  (gcc_checking_assert (!(S)->dr_aux.dr), (S)->first_element)
-#define REDUC_GROUP_NEXT_ELEMENT(S) \
-  (gcc_checking_assert (!(S)->dr_aux.dr), (S)->next_element)
-#define REDUC_GROUP_SIZE(S) \
-  (gcc_checking_assert (!(S)->dr_aux.dr), (S)->size)
-
 #define STMT_VINFO_RELEVANT_P(S)          ((S)->relevant != 
vect_unused_in_scope)
 
 #define PURE_SLP_STMT(S)                  ((S)->slp_type == pure_slp)
-- 
2.51.0

Reply via email to