summaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index feddfa2287c..436d04cb305 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -91,7 +91,7 @@ vec<stmt_vec_info> stmt_vec_info_vec;
struct simduid_to_vf : free_ptr_hash<simduid_to_vf>
{
unsigned int simduid;
- int vf;
+ poly_uint64 vf;
/* hash_table support. */
static inline hashval_t hash (const simduid_to_vf *);
@@ -161,7 +161,7 @@ adjust_simduid_builtins (hash_table<simduid_to_vf> *htab)
for (i = gsi_start_bb (bb); !gsi_end_p (i); )
{
- unsigned int vf = 1;
+ poly_uint64 vf = 1;
enum internal_fn ifn;
gimple *stmt = gsi_stmt (i);
tree t;
@@ -338,7 +338,7 @@ shrink_simd_arrays
if ((*iter)->simduid != -1U)
{
tree decl = (*iter)->decl;
- int vf = 1;
+ poly_uint64 vf = 1;
if (simduid_to_vf_htab)
{
simduid_to_vf *p = NULL, data;
@@ -847,7 +847,8 @@ vectorize_loops (void)
if (loop_vinfo)
has_mask_store = LOOP_VINFO_HAS_MASK_STORE (loop_vinfo);
delete loop_vinfo;
- if (has_mask_store)
+ if (has_mask_store
+ && targetm.vectorize.empty_mask_is_expensive (IFN_MASK_STORE))
optimize_mask_stores (loop);
loop->aux = NULL;
}
@@ -1036,12 +1037,13 @@ static unsigned
get_vec_alignment_for_array_type (tree type)
{
gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
+ poly_uint64 array_size, vector_size;
tree vectype = get_vectype_for_scalar_type (strip_array_types (type));
if (!vectype
- || !TYPE_SIZE (type)
- || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
- || tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE (vectype)))
+ || !poly_int_tree_p (TYPE_SIZE (type), &array_size)
+ || !poly_int_tree_p (TYPE_SIZE (vectype), &vector_size)
+ || must_lt (array_size, vector_size))
return 0;
return TYPE_ALIGN (vectype);