re PR target/57796 (AVX2 gather vectorization: code bloat and reduction of performance)
authorRichard Biener <rguenther@suse.de>
Thu, 20 Apr 2017 14:26:26 +0000 (14:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 20 Apr 2017 14:26:26 +0000 (14:26 +0000)
2017-04-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/57796
* tree-vect-stmts.c (vect_model_store_cost): Cost scatters
as N scalar stores.
(vect_model_load_cost): Cost gathers as N scalar loads.

From-SVN: r247026

gcc/ChangeLog
gcc/tree-vect-stmts.c

index fc1260739e080ed19ea77a4385ec1479bb2e9477..1ee54cfe91d51ca5aa93c4bdc2e63d687106eae8 100644 (file)
@@ -1,3 +1,10 @@
+2017-04-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57796
+       * tree-vect-stmts.c (vect_model_store_cost): Cost scatters
+       as N scalar stores.
+       (vect_model_load_cost): Cost gathers as N scalar loads.
+
 2017-04-20  Richard Biener  <rguenther@suse.de>
 
        * ggc-page.c (ggc_allocated_p): Rename to ...
index bfb7185f5e0eb7333e1a6cb74e2f5eb95b5f4f8e..31349f2b9c13dabbcf138f93bf3e39605539591d 100644 (file)
@@ -929,7 +929,8 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
 
   tree vectype = STMT_VINFO_VECTYPE (stmt_info);
   /* Costs of the stores.  */
-  if (memory_access_type == VMAT_ELEMENTWISE)
+  if (memory_access_type == VMAT_ELEMENTWISE
+      || memory_access_type == VMAT_GATHER_SCATTER)
     /* N scalar stores plus extracting the elements.  */
     inside_cost += record_stmt_cost (body_cost_vec,
                                     ncopies * TYPE_VECTOR_SUBPARTS (vectype),
@@ -1056,7 +1057,8 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies,
     }
 
   /* The loads themselves.  */
-  if (memory_access_type == VMAT_ELEMENTWISE)
+  if (memory_access_type == VMAT_ELEMENTWISE
+      || memory_access_type == VMAT_GATHER_SCATTER)
     {
       /* N scalar loads plus gathering them into a vector.  */
       tree vectype = STMT_VINFO_VECTYPE (stmt_info);