]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[21/46] Make grouped_stores and reduction_chains use stmt_vec_infos
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 31 Jul 2018 14:23:34 +0000 (14:23 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 31 Jul 2018 14:23:34 +0000 (14:23 +0000)
This patch changes the SLP lists grouped_stores and reduction_chains
from auto_vec<gimple *> to auto_vec<stmt_vec_info>.  It was easier
to do them together due to the way vect_analyze_slp is structured.

2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vectorizer.h (vec_info::grouped_stores): Change from
an auto_vec<gimple *> to an auto_vec<stmt_vec_info>.
(_loop_vec_info::reduction_chains): Likewise.
* tree-vect-loop.c (vect_fixup_scalar_cycles_with_patterns): Update
accordingly.
* tree-vect-slp.c (vect_analyze_slp): Likewise.

From-SVN: r263136

gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h

index 7d62f29a525aa5e152e8f72313d2b9f5c34e84bf..91deba0361a46d34e4268c4d19843534bb0c859d 100644 (file)
@@ -1,3 +1,12 @@
+2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-vectorizer.h (vec_info::grouped_stores): Change from
+       an auto_vec<gimple *> to an auto_vec<stmt_vec_info>.
+       (_loop_vec_info::reduction_chains): Likewise.
+       * tree-vect-loop.c (vect_fixup_scalar_cycles_with_patterns): Update
+       accordingly.
+       * tree-vect-slp.c (vect_analyze_slp): Likewise.
+
 2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-vectorizer.h (_stmt_vec_info::first_element): Change from
index 0b5631b78d3d2db4d11e1764c12c62e363f8a169..e611e9908e33d227325e2914db12a0f32b058b45 100644 (file)
@@ -677,13 +677,13 @@ vect_fixup_reduc_chain (gimple *stmt)
 static void
 vect_fixup_scalar_cycles_with_patterns (loop_vec_info loop_vinfo)
 {
-  gimple *first;
+  stmt_vec_info first;
   unsigned i;
 
   FOR_EACH_VEC_ELT (LOOP_VINFO_REDUCTION_CHAINS (loop_vinfo), i, first)
-    if (STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (first)))
+    if (STMT_VINFO_IN_PATTERN_P (first))
       {
-       stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (vinfo_for_stmt (first));
+       stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (first);
        while (next)
          {
            if (! STMT_VINFO_IN_PATTERN_P (next))
@@ -696,7 +696,7 @@ vect_fixup_scalar_cycles_with_patterns (loop_vec_info loop_vinfo)
          {
            vect_fixup_reduc_chain (first);
            LOOP_VINFO_REDUCTION_CHAINS (loop_vinfo)[i]
-             = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (first));
+             = STMT_VINFO_RELATED_STMT (first);
          }
       }
 }
index 665ee4f7395f5d15d9c684547096e93ee7130128..67877959dde1d8500a46706a8e33a94cf43d4ca8 100644 (file)
@@ -2202,7 +2202,7 @@ bool
 vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
 {
   unsigned int i;
-  gimple *first_element;
+  stmt_vec_info first_element;
 
   DUMP_VECT_SCOPE ("vect_analyze_slp");
 
@@ -2220,17 +2220,15 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
                                             max_tree_size))
              {
                /* Dissolve reduction chain group.  */
-               gimple *stmt = first_element;
-               while (stmt)
+               stmt_vec_info vinfo = first_element;
+               while (vinfo)
                  {
-                   stmt_vec_info vinfo = vinfo_for_stmt (stmt);
                    stmt_vec_info next = REDUC_GROUP_NEXT_ELEMENT (vinfo);
                    REDUC_GROUP_FIRST_ELEMENT (vinfo) = NULL;
                    REDUC_GROUP_NEXT_ELEMENT (vinfo) = NULL;
-                   stmt = next;
+                   vinfo = next;
                  }
-               STMT_VINFO_DEF_TYPE (vinfo_for_stmt (first_element))
-                 = vect_internal_def;
+               STMT_VINFO_DEF_TYPE (first_element) = vect_internal_def;
              }
        }
 
index fe49843aa66e820ee8b7142ff9215250f774f403..24020d239f124ab86334eeebd39c621c9e19ff91 100644 (file)
@@ -259,7 +259,7 @@ struct vec_info {
 
   /* All interleaving chains of stores, represented by the first
      stmt in the chain.  */
-  auto_vec<gimple *> grouped_stores;
+  auto_vec<stmt_vec_info> grouped_stores;
 
   /* Cost data used by the target cost model.  */
   void *target_cost_data;
@@ -479,7 +479,7 @@ typedef struct _loop_vec_info : public vec_info {
 
   /* All reduction chains in the loop, represented by the first
      stmt in the chain.  */
-  auto_vec<gimple *> reduction_chains;
+  auto_vec<stmt_vec_info> reduction_chains;
 
   /* Cost vector for a single scalar iteration.  */
   auto_vec<stmt_info_for_cost> scalar_cost_vec;