diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-07-06 08:10:29 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2016-07-06 08:10:29 +0000 |
commit | c01e092fb3a8fb91602b54d8b5f10cc23c27089c (patch) | |
tree | 0daff3f21291e1046e74e89d511da9120198237f /gcc/tree-vect-stmts.c | |
parent | a07189f4555b29f44945e548461ef26246a917f2 (diff) | |
download | gcc-c01e092fb3a8fb91602b54d8b5f10cc23c27089c.zip gcc-c01e092fb3a8fb91602b54d8b5f10cc23c27089c.tar.gz gcc-c01e092fb3a8fb91602b54d8b5f10cc23c27089c.tar.bz2 |
[1/7] Remove unnecessary peeling for gaps check
I recently relaxed the peeling-for-gaps conditions for LD3 but
kept them as-is for load-and-permute. I don't think the conditions
are needed for load-and-permute either though. No current load-and-
permute should load outside the group, so if there is no gap at the end,
the final vector element loaded will correspond to an element loaded
by the original scalar loop.
The patch for PR68559 (a missed optimisation PR) increased the peeled
cases from "exact_log2 (groupsize) == -1" to "vf % group_size == 0", so
before that fix, we didn't peel for gaps if there was no gap at the end
of the group and if the group size was a power of 2.
The only current non-power-of-2 load-and-permute size is 3, which
doesn't require loading more than 3 vectors.
The testcase is based on gcc.dg/vect/pr49038.c.
Tested on aarch64-linux-gnu and x86_64-linux-gnu.
gcc/
* tree-vect-stmts.c (vectorizable_load): Remove unnecessary
peeling-for-gaps condition.
gcc/testsuite/
* gcc.dg/vect/group-no-gaps-1.c: New test.
From-SVN: r238033
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index c41550d..d0a3892 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6373,13 +6373,11 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, gcc_assert (GROUP_GAP (stmt_info)); } - /* If there is a gap in the end of the group or the group size cannot - be made a multiple of the vector element count then we access excess + /* If there is a gap in the end of the group then we access excess elements in the last iteration and thus need to peel that off. */ if (loop_vinfo && ! STMT_VINFO_STRIDED_P (stmt_info) - && (GROUP_GAP (vinfo_for_stmt (first_stmt)) != 0 - || (!slp && !load_lanes_p && vf % group_size != 0))) + && GROUP_GAP (vinfo_for_stmt (first_stmt)) != 0) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, |