Commit b6339213 by Jakub Jelinek Committed by Jakub Jelinek

omp-low.c (lower_rec_input_clauses): Don't force simd arrays for lastprivate…

omp-low.c (lower_rec_input_clauses): Don't force simd arrays for lastprivate non-addressable iterator of a...

	* omp-low.c (lower_rec_input_clauses): Don't force simd arrays for
	lastprivate non-addressable iterator of a collapse(1) simd.

	* gcc.dg/vect/vect-simd-16.c: New test.

From-SVN: r273620
parent 05584e7c
2019-07-20 Jakub Jelinek <jakub@redhat.com>
* omp-low.c (lower_rec_input_clauses): Don't force simd arrays for
lastprivate non-addressable iterator of a collapse(1) simd.
2019-07-17 Bill Seurer <seurer@linux.vnet.ibm.com>
* config/rs6000/rs6000-call.c (HAVE_AS_GNU_ATTRIBUTE): define value
......
......@@ -5097,7 +5097,10 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
{
tree y = lang_hooks.decls.omp_clause_dtor (c, new_var);
if ((TREE_ADDRESSABLE (new_var) || nx || y
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
|| (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
&& (gimple_omp_for_collapse (ctx->stmt) != 1
|| (gimple_omp_for_index (ctx->stmt, 0)
!= new_var)))
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE__CONDTEMP_
|| omp_is_reference (var))
&& lower_rec_simd_input_clauses (new_var, ctx, &sctx,
......
2019-07-20 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/vect/vect-simd-16.c: New test.
2019-07-19 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/ssa-dse-37.c: New test.
......
/* { dg-additional-options "-fopenmp-simd" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
/* { dg-final { scan-tree-dump-times "vectorized \[1-3] loops" 3 "vect" { target i?86-*-* x86_64-*-* } } } */
#include "tree-vect.h"
__attribute__((noipa)) int
foo (int *a)
{
int i;
#pragma omp simd lastprivate (i)
for (i = 0; i < 64; i++)
a[i] = i;
return i;
}
__attribute__((noipa)) void
bar (int *a)
{
int i;
#pragma omp simd private (i)
for (i = 0; i < 64; i++)
a[i] = i + 1;
}
__attribute__((noipa)) int
baz (int *a)
{
int i;
#pragma omp simd linear (i)
for (i = 0; i < 64; i++)
a[i] = i + 2;
return i;
}
int
main ()
{
int i;
int a[64];
check_vect ();
if (foo (a) != 64)
abort ();
for (i = 0; i < 64; ++i)
if (a[i] != i)
abort ();
else
a[i] = -8;
bar (a);
for (i = 0; i < 64; ++i)
if (a[i] != i + 1)
abort ();
else
a[i] = -8;
if (baz (a) != 64)
abort ();
for (i = 0; i < 64; ++i)
if (a[i] != i + 2)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment