1 /* PR tree-optimization/68128 */
2 /* { dg-do compile } */
3 /* { dg-options "-Ofast -fopenmp -fdump-tree-vect-details" } */
4 /* { dg-additional-options "-mavx" { target i?86-*-* x86_64-*-* } } */
6 /* Make sure the following loop is vectorized even when not using
7 firstprivate variables for scalar vars that are not modified
8 in the parallel region. */
11 foo (float *u
, float v
, float w
, float x
, float y
, float z
, float t
)
15 #pragma omp parallel for private (i, j, k, l, a, b, c, s, e)
16 for (j
= 0; j
< 1024; j
++)
22 for (i
= k
; i
<= l
; i
++, b
++, a
+= w
)
25 s
= (1.f
- c
* x
) * (1.f
- c
* x
);
26 e
= t
* (1 / __builtin_sqrtf (c
)) * s
;
27 *b
+= (c
< z
? e
: 0);
32 /* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target i?86-*-* x86_64-*-* } } } */