aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-10-17 19:35:54 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2017-10-17 17:35:54 +0000
commitcc9fe6bbd78a0b1740c5c1c5713d36e3da6e7165 (patch)
treee78cd4c746e37e3704a970e517a94b3df6a8bdee
parent7061821d4aa300b600f689cadb994d7658600414 (diff)
downloadgcc-cc9fe6bbd78a0b1740c5c1c5713d36e3da6e7165.zip
gcc-cc9fe6bbd78a0b1740c5c1c5713d36e3da6e7165.tar.gz
gcc-cc9fe6bbd78a0b1740c5c1c5713d36e3da6e7165.tar.bz2
target.h (enum vect_cost_for_stmt): Add vec_gather_load and vec_scatter_store
* 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
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/aarch64/aarch64.c2
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/config/powerpcspe/powerpcspe.c2
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/config/s390/s390.c2
-rw-r--r--gcc/config/spu/spu.c2
-rw-r--r--gcc/target.h2
-rw-r--r--gcc/tree-vect-stmts.c6
9 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c7fac7..6b9a62e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ec05587..ed30b8c 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -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:
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 557c971..013e7d9 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -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:
diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c
index 528f62d..0f90e95 100644
--- a/gcc/config/powerpcspe/powerpcspe.c
+++ b/gcc/config/powerpcspe/powerpcspe.c
@@ -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;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index b08cd31..4837e14 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3ef3c19..6e3ac3b 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -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:
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index b9af9a9..eda7fca 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -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:
diff --git a/gcc/target.h b/gcc/target.h
index ac43b16..6260193 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -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,
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index d3fa516..7e5fe4c 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -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;