aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 21:46:52 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 21:46:52 +0000
commit9ce4345afba69ff793ff4df992fc57ec29a92d93 (patch)
treeb672fc54e997a7f148e43c35b67510461492bf21 /gcc
parente251d3ec013bc46d58470988fc45566051a9030b (diff)
downloadgcc-9ce4345afba69ff793ff4df992fc57ec29a92d93.zip
gcc-9ce4345afba69ff793ff4df992fc57ec29a92d93.tar.gz
gcc-9ce4345afba69ff793ff4df992fc57ec29a92d93.tar.bz2
Make vect_model_store_cost take a vec_load_store_type
This patch makes vect_model_store_cost take a vec_load_store_type instead of a vect_def_type. It's a wash on its own, but it helps with later patches. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c (vect_model_store_cost): Take a vec_load_store_type instead of a vect_def_type. * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h. (vect_model_store_cost): Take a vec_load_store_type instead of a vect_def_type. (vectorizable_mask_load_store): Update accordingly. (vectorizable_store): Likewise. * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly. From-SVN: r256211
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/tree-vect-slp.c2
-rw-r--r--gcc/tree-vect-stmts.c18
-rw-r--r--gcc/tree-vectorizer.h10
4 files changed, 27 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 309c009..be6d5e1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,17 @@
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
+ * tree-vectorizer.h (vec_load_store_type): Moved from tree-vec-stmts.c
+ (vect_model_store_cost): Take a vec_load_store_type instead of a
+ vect_def_type.
+ * tree-vect-stmts.c (vec_load_store_type): Move to tree-vectorizer.h.
+ (vect_model_store_cost): Take a vec_load_store_type instead of a
+ vect_def_type.
+ (vectorizable_mask_load_store): Update accordingly.
+ (vectorizable_store): Likewise.
+ * tree-vect-slp.c (vect_analyze_slp_cost_1): Update accordingly.
+
+2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
+
* tree-vect-loop.c (vect_transform_loop): Stub out scalar
IFN_MASK_LOAD calls here rather than...
* tree-vect-stmts.c (vectorizable_mask_load_store): ...here.
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 2563fc0..2a6d924 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1736,7 +1736,7 @@ vect_analyze_slp_cost_1 (slp_instance instance, slp_tree node,
: VMAT_CONTIGUOUS);
if (DR_IS_WRITE (STMT_VINFO_DATA_REF (stmt_info)))
vect_model_store_cost (stmt_info, ncopies_for_cost,
- memory_access_type, vect_uninitialized_def,
+ memory_access_type, VLS_STORE,
node, prologue_cost_vec, body_cost_vec);
else
{
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 96c6605..cdca95a 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -54,14 +54,6 @@ along with GCC; see the file COPYING3. If not see
/* For lang_hooks.types.type_for_mode. */
#include "langhooks.h"
-/* Says whether a statement is a load, a store of a vectorized statement
- result, or a store of an invariant value. */
-enum vec_load_store_type {
- VLS_LOAD,
- VLS_STORE,
- VLS_STORE_INVARIANT
-};
-
/* Return the vectorized type for the given statement. */
tree
@@ -908,7 +900,7 @@ vect_model_promotion_demotion_cost (stmt_vec_info stmt_info,
void
vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
vect_memory_access_type memory_access_type,
- enum vect_def_type dt, slp_tree slp_node,
+ vec_load_store_type vls_type, slp_tree slp_node,
stmt_vector_for_cost *prologue_cost_vec,
stmt_vector_for_cost *body_cost_vec)
{
@@ -917,7 +909,7 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
gimple *first_stmt = STMT_VINFO_STMT (stmt_info);
bool grouped_access_p = STMT_VINFO_GROUPED_ACCESS (stmt_info);
- if (dt == vect_constant_def || dt == vect_external_def)
+ if (vls_type == VLS_STORE_INVARIANT)
prologue_cost += record_stmt_cost (prologue_cost_vec, 1, scalar_to_vec,
stmt_info, 0, vect_prologue);
@@ -2170,7 +2162,7 @@ vectorizable_mask_load_store (gimple *stmt, gimple_stmt_iterator *gsi,
NULL, NULL, NULL);
else
vect_model_store_cost (stmt_info, ncopies, memory_access_type,
- dt, NULL, NULL, NULL);
+ vls_type, NULL, NULL, NULL);
return true;
}
gcc_assert (memory_access_type == STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info));
@@ -5820,8 +5812,8 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
STMT_VINFO_TYPE (stmt_info) = store_vec_info_type;
/* The SLP costs are calculated during SLP analysis. */
if (!PURE_SLP_STMT (stmt_info))
- vect_model_store_cost (stmt_info, ncopies, memory_access_type, dt,
- NULL, NULL, NULL);
+ vect_model_store_cost (stmt_info, ncopies, memory_access_type,
+ vls_type, NULL, NULL, NULL);
return true;
}
gcc_assert (memory_access_type == STMT_VINFO_MEMORY_ACCESS_TYPE (stmt_info));
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index d72e39a..150b268 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -520,6 +520,14 @@ enum slp_vect_type {
hybrid
};
+/* Says whether a statement is a load, a store of a vectorized statement
+ result, or a store of an invariant value. */
+enum vec_load_store_type {
+ VLS_LOAD,
+ VLS_STORE,
+ VLS_STORE_INVARIANT
+};
+
/* Describes how we're going to vectorize an individual load or store,
or a group of loads or stores. */
enum vect_memory_access_type {
@@ -1220,7 +1228,7 @@ extern void vect_model_simple_cost (stmt_vec_info, int, enum vect_def_type *,
int, stmt_vector_for_cost *,
stmt_vector_for_cost *);
extern void vect_model_store_cost (stmt_vec_info, int, vect_memory_access_type,
- enum vect_def_type, slp_tree,
+ vec_load_store_type, slp_tree,
stmt_vector_for_cost *,
stmt_vector_for_cost *);
extern void vect_model_load_cost (stmt_vec_info, int, vect_memory_access_type,