Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-early-break_2.c

raw
1 /* { dg-add-options vect_early_break } */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target vect_early_break } */
4 /* { dg-require-effective-target vect_int } */
5
6 /* { dg-additional-options "-Ofast" } */
7
8 /* Complex numbers read x and x+1, which on non-load lanes targets require partial loops. */
9 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { { ! "arm*-*-*" } && vect_load_lanes } } } } */
10 /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { { "arm*-*-*" } || { ! vect_load_lanes } } } } } */
11
12 #include <complex.h>
13
14 #define N 1024
15 complex double vect_a[N];
16 complex double vect_b[N];
17
18 complex double test4(complex double x)
19 {
20 complex double ret = 0;
21 for (int i = 0; i < N; i++)
22 {
23 vect_b[i] += x + i;
24 if (vect_a[i] == x)
25 return i;
26 vect_a[i] += x * vect_b[i];
27
28 }
29 return ret;
30 }