aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-expand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-05-20 11:49:07 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-05-20 11:49:07 +0200
commitf63445e56c265757ebd50dc12fcd01773341b49f (patch)
treed479340becf450ff10dc860728aa762dd72177f5 /gcc/omp-expand.c
parent0ec537f3500924f29505977aa89c2a1d4671c584 (diff)
downloadgcc-f63445e56c265757ebd50dc12fcd01773341b49f.zip
gcc-f63445e56c265757ebd50dc12fcd01773341b49f.tar.gz
gcc-f63445e56c265757ebd50dc12fcd01773341b49f.tar.bz2
cfgloop.h (struct loop): Add simdlen member.
* cfgloop.h (struct loop): Add simdlen member. * cfgloopmanip.c (copy_loop_info): Copy simdlen as well. * omp-expand.c (expand_omp_simd): Set it if simdlen clause is present. * tree-vect-loop.c (vect_analyze_loop): Pass loop->simdlen != 0 as new argument to autovectorize_vector_sizes target hook. If loop->simdlen, pick up vector size where the vectorization factor is equal to loop->simd, and if there is none, fall back to the first successful one. (vect_transform_loop): Adjust autovectorize_vector_sizes target hook caller. * omp-low.c (omp_clause_aligned_alignment): Likewise. * omp-general.c (omp_max_vf): Likewise. * optabs-query.c (can_vec_mask_load_store_p): Likewise. * tree-vect-slp.c (vect_slp_bb): Likewise. * target.def (autovectorize_vector_sizes): Add ALL argument and document it. * doc/tm.texi: Adjust documentation. * targhooks.c (default_autovectorize_vector_sizes): Add bool argument. * targhooks.h (default_autovectorize_vector_sizes): Likewise. * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes): Add bool argument. * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise. * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise. * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise. * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise. If true and TARGET_AVX512F or TARGET_AVX, push 3 or 2 sizes even if preferred vector size is not 512-bit or 256-bit, just put those unpreferred ones last. * gcc.target/i386/avx512f-simd-1.c: New test. From-SVN: r271403
Diffstat (limited to 'gcc/omp-expand.c')
-rw-r--r--gcc/omp-expand.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 7415973..0d7f104 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -4974,6 +4974,13 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
&& loop->safelen > 1)
{
loop->force_vectorize = true;
+ if (simdlen && tree_fits_uhwi_p (OMP_CLAUSE_SIMDLEN_EXPR (simdlen)))
+ {
+ unsigned HOST_WIDE_INT v
+ = tree_to_uhwi (OMP_CLAUSE_SIMDLEN_EXPR (simdlen));
+ if (v < INT_MAX && v <= (unsigned HOST_WIDE_INT) loop->safelen)
+ loop->simdlen = v;
+ }
cfun->has_force_vectorize_loops = true;
}
else if (dont_vectorize)