target.h (enum vect_cost_for_stmt): Add vec_gather_load and vec_scatter_store
authorJan Hubicka <hubicka@ucw.cz>
Tue, 17 Oct 2017 17:35:54 +0000 (19:35 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 17 Oct 2017 17:35:54 +0000 (17:35 +0000)
* target.h (enum vect_cost_for_stmt): Add vec_gather_load and
vec_scatter_store
* tree-vect-stmts.c (record_stmt_cost): Make difference between normal
and scatter/gather ops.

* aarch64/aarch64.c (aarch64_builtin_vectorization_cost): Add
vec_gather_load and vec_scatter_store.
* arm/arm.c (arm_builtin_vectorization_cost): Likewise.
* powerpcspe/powerpcspe.c (rs6000_builtin_vectorization_cost): Likewise.
* rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Likewise.
* s390/s390.c (s390_builtin_vectorization_cost): Likewise.
* spu/spu.c (spu_builtin_vectorization_cost): Likewise.

From-SVN: r253823

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/arm/arm.c
gcc/config/powerpcspe/powerpcspe.c
gcc/config/rs6000/rs6000.c
gcc/config/s390/s390.c
gcc/config/spu/spu.c
gcc/target.h
gcc/tree-vect-stmts.c

index 3c7fac739df76d169f3ee27b7677db2fd3fe3637..6b9a62eac2f27b814326b408959ca975e58a4c5c 100644 (file)
@@ -1,3 +1,18 @@
+2017-10-17  Jan Hubicka  <hubicka@ucw.cz>
+
+       * target.h (enum vect_cost_for_stmt): Add vec_gather_load and
+       vec_scatter_store
+       * tree-vect-stmts.c (record_stmt_cost): Make difference between normal
+       and scatter/gather ops.
+
+       * aarch64/aarch64.c (aarch64_builtin_vectorization_cost): Add
+       vec_gather_load and vec_scatter_store.
+       * arm/arm.c (arm_builtin_vectorization_cost): Likewise.
+       * powerpcspe/powerpcspe.c (rs6000_builtin_vectorization_cost): Likewise.
+       * rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Likewise.
+       * s390/s390.c (s390_builtin_vectorization_cost): Likewise.
+       * spu/spu.c (spu_builtin_vectorization_cost): Likewise.
+
 2017-10-17  Uros Bizjak  <ubizjak@gmail.com>
 
        * reg-stack.c (compare_for_stack_reg): Add bool argument.
index ec055876a744d8693741a9d716cd1f60c423f3cd..ed30b8c5858a746415e1f666a2e7b1bfda623e5d 100644 (file)
@@ -8559,9 +8559,11 @@ aarch64_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
        return costs->scalar_to_vec_cost;
 
       case unaligned_load:
+      case vector_gather_load:
        return costs->vec_unalign_load_cost;
 
       case unaligned_store:
+      case vector_scatter_store:
        return costs->vec_unalign_store_cost;
 
       case cond_branch_taken:
index 557c971e80dfbf0321c1c64545eaed6ddf5e8c88..013e7d91df001549c86b6d1a986590e9f5428f41 100644 (file)
@@ -11253,9 +11253,11 @@ arm_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return current_tune->vec_costs->scalar_to_vec_cost;
 
       case unaligned_load:
+      case vector_gather_load:
         return current_tune->vec_costs->vec_unalign_load_cost;
 
       case unaligned_store:
+      case vector_scatter_store:
         return current_tune->vec_costs->vec_unalign_store_cost;
 
       case cond_branch_taken:
index 528f62da71d7ecb831f87226c798d86dcd4b43d8..0f90e95f1e0ae38914c5c44132b20152f130fc1e 100644 (file)
@@ -5855,6 +5855,7 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return 3;
 
       case unaligned_load:
+      case vector_gather_load:
        if (TARGET_P9_VECTOR)
          return 3;
 
@@ -5896,6 +5897,7 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return 2;
 
       case unaligned_store:
+      case vector_scatter_store:
        if (TARGET_EFFICIENT_UNALIGNED_VSX)
          return 1;
 
index b08cd316e6876fc85f61d8f6a28639efc2219734..4837e14a0e62d7408cf515e80051ebba610df244 100644 (file)
@@ -5419,6 +5419,7 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return 3;
 
       case unaligned_load:
+      case vector_gather_load:
        if (TARGET_EFFICIENT_UNALIGNED_VSX)
          return 1;
 
@@ -5457,6 +5458,7 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return 2;
 
       case unaligned_store:
+      case vector_scatter_store:
        if (TARGET_EFFICIENT_UNALIGNED_VSX)
          return 1;
 
index 3ef3c197fed830107130501470a4b29480730bdd..6e3ac3b7d0f96dac56df0f8fa7573cdcc1b87ea3 100644 (file)
@@ -3717,6 +3717,8 @@ s390_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
       case vector_stmt:
       case vector_load:
       case vector_store:
+      case vector_gather_load:
+      case vector_scatter_store:
       case vec_to_scalar:
       case scalar_to_vec:
       case cond_branch_not_taken:
index b9af9a969f7afdef93541e5384565f95d5abf630..eda7fcaaeb9ec21eea51a95403a982a4c5fcdee9 100644 (file)
@@ -6640,6 +6640,8 @@ spu_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return 2;
 
       case unaligned_load:
+      case vector_gather_load:
+      case vector_scatter_store:
         return 2;
 
       case cond_branch_taken:
index ac43b16a549cf6efba7a9372bfb2d62355254c81..62601933338497837948744c50fc9859ef05d82a 100644 (file)
@@ -171,9 +171,11 @@ enum vect_cost_for_stmt
   scalar_store,
   vector_stmt,
   vector_load,
+  vector_gather_load,
   unaligned_load,
   unaligned_store,
   vector_store,
+  vector_scatter_store,
   vec_to_scalar,
   scalar_to_vec,
   cond_branch_not_taken,
index d3fa5164238895b4e0f78e80f98ccf6744a52a7e..7e5fe4c7cadcfc95d600be0c875a38b60896bf45 100644 (file)
@@ -95,6 +95,12 @@ record_stmt_cost (stmt_vector_for_cost *body_cost_vec, int count,
                  enum vect_cost_for_stmt kind, stmt_vec_info stmt_info,
                  int misalign, enum vect_cost_model_location where)
 {
+  if ((kind == vector_load || kind == unaligned_load)
+      && STMT_VINFO_GATHER_SCATTER_P (stmt_info))
+    kind = vector_gather_load;
+  if ((kind == vector_store || kind == unaligned_store)
+      && STMT_VINFO_GATHER_SCATTER_P (stmt_info))
+    kind = vector_scatter_store;
   if (body_cost_vec)
     {
       tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;