aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-13 18:00:31 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-13 18:00:31 +0000
commit4aa157e8d2aec2e4f9e97dcee86068135e0dcb2f (patch)
tree99c1b77bf8b46d8dacdacdaaeba64d79aaf2f997 /gcc/tree-vect-data-refs.c
parentbb6c2b68d6961dfe98bece34e4418d7287ce7089 (diff)
downloadgcc-4aa157e8d2aec2e4f9e97dcee86068135e0dcb2f.zip
gcc-4aa157e8d2aec2e4f9e97dcee86068135e0dcb2f.tar.gz
gcc-4aa157e8d2aec2e4f9e97dcee86068135e0dcb2f.tar.bz2
Allow single-element interleaving for non-power-of-2 strides
This allows LD3 to be used for isolated a[i * 3] accesses, in a similar way to the current a[i * 2] and a[i * 4] for LD2 and LD4 respectively. Given the problems with the cost model underestimating the cost of elementwise accesses, the patch continues to reject the VMAT_ELEMENTWISE cases that are currently rejected. 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-vect-data-refs.c (vect_analyze_group_access_1): Allow single-element interleaving even if the size is not a power of 2. * tree-vect-stmts.c (get_load_store_type): Disallow elementwise accesses for single-element interleaving if the group size is not a power of 2. gcc/testsuite/ * gcc.target/aarch64/sve/struct_vect_18.c: New test. * gcc.target/aarch64/sve/struct_vect_18_run.c: Likewise. * gcc.target/aarch64/sve/struct_vect_19.c: Likewise. * gcc.target/aarch64/sve/struct_vect_19_run.c: Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256634
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 23b1084..59462be 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2427,11 +2427,10 @@ vect_analyze_group_access_1 (struct data_reference *dr)
element of the group that is accessed in the loop. */
/* Gaps are supported only for loads. STEP must be a multiple of the type
- size. The size of the group must be a power of 2. */
+ size. */
if (DR_IS_READ (dr)
&& (dr_step % type_size) == 0
- && groupsize > 0
- && pow2p_hwi (groupsize))
+ && groupsize > 0)
{
GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = stmt;
GROUP_SIZE (vinfo_for_stmt (stmt)) = groupsize;