]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
move permute optimization to optimize-slp
authorRichard Biener <rguenther@suse.de>
Tue, 29 Sep 2020 10:01:26 +0000 (12:01 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 29 Sep 2020 12:44:04 +0000 (14:44 +0200)
This moves optimizing permutes of SLP reductions to vect_optimize_slp,
eliding the global slp_loads array.

2020-09-29  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_analyze_slp): Move SLP reduction
re-arrangement and SLP graph load gathering...
(vect_optimize_slp): ... here.
* tree-vectorizer.h (vec_info::slp_loads): Remove.

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

index c44fd396bf0b69a4153e46026c545bebb3797551..8de248025386a18f7ba4cdb978a6c7b0095cdb66 100644 (file)
@@ -2486,8 +2486,15 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
       vect_free_slp_tree ((*it).second);
   delete bst_map;
 
+  return opt_result::success ();
+}
+
+void
+vect_optimize_slp (vec_info *vinfo)
+{
   /* Optimize permutations in SLP reductions.  */
   slp_instance instance;
+  unsigned i;
   FOR_EACH_VEC_ELT (vinfo->slp_instances, i, instance)
     {
       slp_tree node = SLP_INSTANCE_TREE (instance);
@@ -2500,20 +2507,14 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size)
     }
 
   /* Gather all loads in the SLP graph.  */
+  auto_vec<slp_tree> slp_loads;
   hash_set<slp_tree> visited;
   FOR_EACH_VEC_ELT (vinfo->slp_instances, i, instance)
-    vect_gather_slp_loads (vinfo->slp_loads, SLP_INSTANCE_TREE (instance),
+    vect_gather_slp_loads (slp_loads, SLP_INSTANCE_TREE (instance),
                           visited);
 
-  return opt_result::success ();
-}
-
-void
-vect_optimize_slp (vec_info *vinfo)
-{
   slp_tree node;
-  unsigned i;
-  FOR_EACH_VEC_ELT (vinfo->slp_loads, i, node)
+  FOR_EACH_VEC_ELT (slp_loads, i, node)
     {
       if (!SLP_TREE_LOAD_PERMUTATION (node).exists ())
        continue;
index b7fa6bc8d2ff775653cdbff168700789b5822ac9..e62f1ccee8d8aef346f5d85a3d6b1bef178861cb 100644 (file)
@@ -359,7 +359,6 @@ public:
 
   /* The SLP graph.  */
   auto_vec<slp_instance> slp_instances;
-  auto_vec<slp_tree> slp_loads;
 
   /* Maps base addresses to an innermost_loop_behavior that gives the maximum
      known alignment for that base.  */