diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-05-24 10:13:35 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2016-05-24 10:13:35 +0000 |
commit | 836dbb1a27f3e793ad32723aeb6630237887e6d5 (patch) | |
tree | 424962ab1d41c98e6fba733950a5329a6bc15160 /gcc | |
parent | f17a223de829cb5fa0b32a9f12c22a4fa929506c (diff) | |
download | gcc-836dbb1a27f3e793ad32723aeb6630237887e6d5.zip gcc-836dbb1a27f3e793ad32723aeb6630237887e6d5.tar.gz gcc-836dbb1a27f3e793ad32723aeb6630237887e6d5.tar.bz2 |
Fix GROUP_GAP for single-element interleaving
vectorizable_load had a curious "force_peeling" variable, with no
comment explaining why we need it for single-element interleaving
but not for other cases. I think it's simply because we weren't
initialising the GROUP_GAP correctly for single loads.
Tested on aarch64-linux-gnu and x86_64-linux-gnu.
gcc/
* tree-vect-data-refs.c (vect_analyze_group_access_1): Set
GROUP_GAP for single-element interleaving.
* tree-vect-stmts.c (vectorizable_load): Remove force_peeling
variable.
From-SVN: r236631
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 1 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d94460e..a61b6cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-05-24 Richard Sandiford <richard.sandiford@arm.com> + + * tree-vect-data-refs.c (vect_analyze_group_access_1): Set + GROUP_GAP for single-element interleaving. + * tree-vect-stmts.c (vectorizable_load): Remove force_peeling + variable. + 2016-05-24 Richard Biener <rguenther@suse.de> PR middle-end/70434 diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 7652e21..36d302a 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -2233,6 +2233,7 @@ vect_analyze_group_access_1 (struct data_reference *dr) { GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = stmt; GROUP_SIZE (vinfo_for_stmt (stmt)) = groupsize; + GROUP_GAP (stmt_info) = groupsize - 1; if (dump_enabled_p ()) { dump_printf_loc (MSG_NOTE, vect_location, diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 3bcd0ce..f66e180 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6308,7 +6308,6 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, that leaves unused vector loads around punt - we at least create very sub-optimal code in that case (and blow up memory, see PR65518). */ - bool force_peeling = false; if (first_stmt == stmt && !GROUP_NEXT_ELEMENT (stmt_info)) { @@ -6322,7 +6321,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, } /* Single-element interleaving requires peeling for gaps. */ - force_peeling = true; + gcc_assert (GROUP_GAP (stmt_info)); } /* If there is a gap in the end of the group or the group size cannot @@ -6330,8 +6329,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, elements in the last iteration and thus need to peel that off. */ if (loop_vinfo && ! STMT_VINFO_STRIDED_P (stmt_info) - && (force_peeling - || GROUP_GAP (vinfo_for_stmt (first_stmt)) != 0 + && (GROUP_GAP (vinfo_for_stmt (first_stmt)) != 0 || (!slp && vf % GROUP_SIZE (vinfo_for_stmt (first_stmt)) != 0))) { if (dump_enabled_p ()) |