diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:17:06 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:17:06 +0000 |
commit | d8f860ef70b33d0c49f31114c433b6c654c5a588 (patch) | |
tree | 560cf6f3f5cb3fa57e78ed70a07c13a60cdb9570 /gcc/omp-simd-clone.c | |
parent | e112bba2fced713f1fa6c7f41c6925ee4573f215 (diff) | |
download | gcc-d8f860ef70b33d0c49f31114c433b6c654c5a588.zip gcc-d8f860ef70b33d0c49f31114c433b6c654c5a588.tar.gz gcc-d8f860ef70b33d0c49f31114c433b6c654c5a588.tar.bz2 |
poly_int: omp-simd-clone.c
This patch adds a wrapper around TYPE_VECTOR_SUBPARTS for omp-simd-clone.c.
Supporting SIMD clones for variable-length vectors is post GCC8 work.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* omp-simd-clone.c (simd_clone_subparts): New function.
(simd_clone_init_simd_arrays): Use it instead of TYPE_VECTOR_SUBPARTS.
(ipa_simd_modify_function_body): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256145
Diffstat (limited to 'gcc/omp-simd-clone.c')
-rw-r--r-- | gcc/omp-simd-clone.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c index f6a7a27..0626a5a 100644 --- a/gcc/omp-simd-clone.c +++ b/gcc/omp-simd-clone.c @@ -51,6 +51,15 @@ along with GCC; see the file COPYING3. If not see #include "stringpool.h" #include "attribs.h" +/* Return the number of elements in vector type VECTYPE, which is associated + with a SIMD clone. At present these always have a constant length. */ + +static unsigned HOST_WIDE_INT +simd_clone_subparts (tree vectype) +{ + return TYPE_VECTOR_SUBPARTS (vectype); +} + /* Allocate a fresh `simd_clone' and return it. NARGS is the number of arguments to reserve space for. */ @@ -761,7 +770,7 @@ simd_clone_init_simd_arrays (struct cgraph_node *node, } continue; } - if (TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg)) == node->simdclone->simdlen) + if (simd_clone_subparts (TREE_TYPE (arg)) == node->simdclone->simdlen) { tree ptype = build_pointer_type (TREE_TYPE (TREE_TYPE (array))); tree ptr = build_fold_addr_expr (array); @@ -772,7 +781,7 @@ simd_clone_init_simd_arrays (struct cgraph_node *node, } else { - unsigned int simdlen = TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg)); + unsigned int simdlen = simd_clone_subparts (TREE_TYPE (arg)); tree ptype = build_pointer_type (TREE_TYPE (TREE_TYPE (array))); for (k = 0; k < node->simdclone->simdlen; k += simdlen) { @@ -918,8 +927,8 @@ ipa_simd_modify_function_body (struct cgraph_node *node, iter, NULL_TREE, NULL_TREE); if (adjustments[j].op == IPA_PARM_OP_NONE - && TYPE_VECTOR_SUBPARTS (vectype) < node->simdclone->simdlen) - j += node->simdclone->simdlen / TYPE_VECTOR_SUBPARTS (vectype) - 1; + && simd_clone_subparts (vectype) < node->simdclone->simdlen) + j += node->simdclone->simdlen / simd_clone_subparts (vectype) - 1; } l = adjustments.length (); |