Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-live-1.c

raw
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-additional-options "-fno-tree-scev-cprop" } */
5
6 #include "tree-vect.h"
7
8 /* Statement used outside the loop.
9 NOTE: SCEV disabled to ensure the live operation is not removed before
10 vectorization. */
11 __attribute__ ((noinline)) int
12 liveloop (int start, int n, int *x)
13 {
14 int i = start;
15 int j;
16
17 for (j = 0; j < n; ++j)
18 {
19 i += 1;
20 x[j] = i;
21 }
22 return i;
23 }
24
25 #define MAX 62
26 #define START 27
27
28 int
29 main (void)
30 {
31 int a[MAX];
32 int i;
33
34 check_vect ();
35
36 int ret = liveloop (START, MAX, a);
37
38 if (ret != MAX + START)
39 abort ();
40
41 #pragma GCC novector
42 for (i=0; i<MAX; i++)
43 {
44 __asm__ volatile ("");
45 if (a[i] != i+START+1)
46 abort ();
47 }
48 }
49
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
51 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 1 "vect" } } */