aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2016-07-06 08:14:41 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2016-07-06 08:14:41 +0000
commit4fb8ba9d357297206678a3e3eacf9292148eafb5 (patch)
treebec6504ded7b6f968d307ecd48cfc8553e087464 /gcc/tree-vect-stmts.c
parent134c85caeba541ff4fb4377fb12729073cbdfe41 (diff)
downloadgcc-4fb8ba9d357297206678a3e3eacf9292148eafb5.zip
gcc-4fb8ba9d357297206678a3e3eacf9292148eafb5.tar.gz
gcc-4fb8ba9d357297206678a3e3eacf9292148eafb5.tar.bz2
[5/7] Move the fix for PR65518
This patch moves the fix for PR65518 to the code that checks whether load-and-permute operations are supported. If the group size is greater than the vectorisation factor, it would still be possible to fall back to elementwise loads (as for strided groups) rather than fail vectorisation entirely. Tested on aarch64-linux-gnu and x86_64-linux-gnu. gcc/ * tree-vectorizer.h (vect_grouped_load_supported): Add a single_element_p parameter. * tree-vect-data-refs.c (vect_grouped_load_supported): Likewise. Check the PR65518 case here rather than in vectorizable_load. * tree-vect-loop.c (vect_analyze_loop_2): Update call accordignly. * tree-vect-stmts.c (vectorizable_load): Likewise. From-SVN: r238037
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 1a616b2..ab32481 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6315,31 +6315,20 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
+ bool single_element_p = (first_stmt == stmt
+ && !GROUP_NEXT_ELEMENT (stmt_info));
if (!slp && !STMT_VINFO_STRIDED_P (stmt_info))
{
if (vect_load_lanes_supported (vectype, group_size))
load_lanes_p = true;
- else if (!vect_grouped_load_supported (vectype, group_size))
+ else if (!vect_grouped_load_supported (vectype, single_element_p,
+ group_size))
return false;
}
- /* If this is single-element interleaving with an element distance
- that leaves unused vector loads around punt - we at least create
- very sub-optimal code in that case (and blow up memory,
- see PR65518). */
- if (first_stmt == stmt
- && !GROUP_NEXT_ELEMENT (stmt_info))
+ if (single_element_p)
{
- if (GROUP_SIZE (stmt_info) > TYPE_VECTOR_SUBPARTS (vectype))
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "single-element interleaving not supported "
- "for not adjacent vector loads\n");
- return false;
- }
-
/* Single-element interleaving requires peeling for gaps. */
gcc_assert (GROUP_GAP (stmt_info));
}