From c134cf2ab8e329fecda56f61cd977388a200a3d5 Mon Sep 17 00:00:00 2001 From: Yuri Rumyantsev Date: Mon, 1 Jun 2015 17:15:31 +0000 Subject: [PATCH] tree-vect-data-refs.c (vect_analyze_data_ref_access): Allow consecutive accesses within outer-loop with force_vectorize for... gcc/ * tree-vect-data-refs.c (vect_analyze_data_ref_access): Allow consecutive accesses within outer-loop with force_vectorize for references with zero step in inner-loop. gcc/testsuite/ * gcc.dg/vect/vect-outer-simd-1.c: New test. From-SVN: r223993 --- gcc/ChangeLog | 6 ++ gcc/testsuite/ChangeLog | 4 + gcc/testsuite/gcc.dg/vect/vect-outer-simd-1.c | 75 +++++++++++++++++++ gcc/tree-vect-data-refs.c | 10 ++- 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/vect-outer-simd-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d34dc4d69ff..40f0c1f4684 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-06-01 Yuri Rumyantsev + + * tree-vect-data-refs.c (vect_analyze_data_ref_access): Allow + consecutive accesses within outer-loop with force_vectorize + for references with zero step in inner-loop. + 2015-06-01 Vidya Praveen * Makefile.in: Pick up gcov-dump dependencies from gcc/ directory diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 076f164f6eb..8168fabd76c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-06-01 Yuri Rumyantsev + + * gcc.dg/vect/vect-outer-simd-1.c: New test. + 2015-06-01 Matthew Wahab PR target/65697 diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-simd-1.c b/gcc/testsuite/gcc.dg/vect/vect-outer-simd-1.c new file mode 100644 index 00000000000..d9754a3576e --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-outer-simd-1.c @@ -0,0 +1,75 @@ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-additional-options "-fopenmp-simd -ffast-math" } */ +#include +#include "tree-vect.h" +#define N 64 + +float *px, *py; +float *tx, *ty; +float *x1, *z1, *t1, *t2; + +static void inline bar(const float cx, float cy, + float *vx, float *vy) +{ + int j; + for (j = 0; j < N; ++j) + { + const float dx = cx - px[j]; + const float dy = cy - py[j]; + *vx -= dx * tx[j]; + *vy -= dy * ty[j]; + } +} + +__attribute__((noinline, noclone)) void foo1 () +{ + int i; +#pragma omp simd + for (i=0; iforce_vectorize) { if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "zero step in inner loop of nest\n"); return false; } - return DR_IS_READ (dr); } if (loop && nested_in_vect_loop_p (loop, stmt)) -- 2.30.2