diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:15:41 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:15:41 +0000 |
commit | 9031b367ac87550552318f6516487c70f3ce9a99 (patch) | |
tree | 3c2f31193c20f7a35a175565a82dfd104af01499 | |
parent | 86e3672871beff63eebb195642566224c9f80891 (diff) | |
download | gcc-9031b367ac87550552318f6516487c70f3ce9a99.zip gcc-9031b367ac87550552318f6516487c70f3ce9a99.tar.gz gcc-9031b367ac87550552318f6516487c70f3ce9a99.tar.bz2 |
poly_int: vector_alignment_reachable_p
This patch makes vector_alignment_reachable_p cope with variable-length
vectors.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the
number of units as polynomial.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256132
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39f3a91..e42270c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,13 @@ Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> + * tree-vect-data-refs.c (vector_alignment_reachable_p): Treat the + number of units as polynomial. + +2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + * target.h (vector_sizes, auto_vector_sizes): New typedefs. * target.def (autovectorize_vector_sizes): Return the vector sizes by pointer, using vector_sizes rather than a bitmask. diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 02a3295..2e02be5 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1154,16 +1154,17 @@ vector_alignment_reachable_p (struct data_reference *dr) the prolog loop ({VF - misalignment}), is a multiple of the number of the interleaved accesses. */ int elem_size, mis_in_elements; - int nelements = TYPE_VECTOR_SUBPARTS (vectype); /* FORNOW: handle only known alignment. */ if (!known_alignment_for_access_p (dr)) return false; - elem_size = GET_MODE_SIZE (TYPE_MODE (vectype)) / nelements; + poly_uint64 nelements = TYPE_VECTOR_SUBPARTS (vectype); + poly_uint64 vector_size = GET_MODE_SIZE (TYPE_MODE (vectype)); + elem_size = vector_element_size (vector_size, nelements); mis_in_elements = DR_MISALIGNMENT (dr) / elem_size; - if ((nelements - mis_in_elements) % GROUP_SIZE (stmt_info)) + if (!multiple_p (nelements - mis_in_elements, GROUP_SIZE (stmt_info))) return false; } |