aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-04-09 07:50:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-04-09 07:50:51 +0000
commit6c0b8df123c24ef3c14305698eb2910bcf5979ce (patch)
treece1f3f2a80c1d9c1d87e83067b554b50ec414656 /gcc
parent31215daa9b8099963fc1fb04abd13f6321f02a74 (diff)
downloadgcc-6c0b8df123c24ef3c14305698eb2910bcf5979ce.zip
gcc-6c0b8df123c24ef3c14305698eb2910bcf5979ce.tar.gz
gcc-6c0b8df123c24ef3c14305698eb2910bcf5979ce.tar.bz2
SVE fallout from PR90006
2019-04-08 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always use gimple_expr_type for load and store calls. Skip over the condition argument in a conditional internal function. Protect use of TREE_INT_CST_LOW. From-SVN: r270222
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-vect-data-refs.c29
2 files changed, 29 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c951ce8..f1d18b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-09 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always
+ use gimple_expr_type for load and store calls. Skip over the
+ condition argument in a conditional internal function.
+ Protect use of TREE_INT_CST_LOW.
+
2019-04-09 Jakub Jelinek <jakub@redhat.com>
PR target/90015
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 8f185c9..271cb58 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -145,14 +145,29 @@ vect_get_smallest_scalar_type (stmt_vec_info stmt_info,
if (rhs < lhs)
scalar_type = rhs_type;
}
- else if (is_gimple_call (stmt_info->stmt)
- && gimple_call_num_args (stmt_info->stmt) > 0)
+ else if (gcall *call = dyn_cast <gcall *> (stmt_info->stmt))
{
- tree rhs_type = TREE_TYPE (gimple_call_arg (stmt_info->stmt, 0));
-
- rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type));
- if (rhs < lhs)
- scalar_type = rhs_type;
+ unsigned int i = 0;
+ if (gimple_call_internal_p (call))
+ {
+ internal_fn ifn = gimple_call_internal_fn (call);
+ if (internal_load_fn_p (ifn) || internal_store_fn_p (ifn))
+ /* gimple_expr_type already picked the type of the loaded
+ or stored data. */
+ i = ~0U;
+ else if (internal_fn_mask_index (ifn) == 0)
+ i = 1;
+ }
+ if (i < gimple_call_num_args (call))
+ {
+ tree rhs_type = TREE_TYPE (gimple_call_arg (call, i));
+ if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (rhs_type)))
+ {
+ rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type));
+ if (rhs < lhs)
+ scalar_type = rhs_type;
+ }
+ }
}
*lhs_size_unit = lhs;