i386: Adjust rtx cost for imulq and imulw [PR115749]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-live-slp-2.c
blobc9987018e88b04f5f0ff195baaf528ad86722714
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" } */
6 #include "tree-vect.h"
8 /* Statement in SLP vectorization used outside the loop.
9 NOTE: SCEV disabled to ensure the live operation is not removed before
10 vectorization. */
11 #define LIVELOOP(RET) \
12 __attribute__ ((noinline)) int \
13 liveloop##RET (int n, int *x, int *y) \
14 { \
15 int n0, n1, j; \
16 for (j = 0; j < n; ++j) \
17 { \
18 n0 = x[(j*2)]; \
19 n1 = x[(j*2)+1]; \
20 y[(j*2)] = n0 + 1; \
21 y[(j*2)+1] = n1 + 2; \
22 } \
23 return n##RET; \
26 LIVELOOP (0)
27 LIVELOOP (1)
28 typedef int (*FP)(int n, int *x, int *y);
29 const FP llf[]= {&liveloop0, &liveloop1};
31 #define MAX 137
33 int
34 main (void)
36 int a[MAX*4];
37 int b[MAX*4];
38 int i;
40 check_vect ();
42 for (i=0; i<MAX*2; i++)
44 __asm__ volatile ("");
45 a[i] = i;
48 #pragma GCC novector
49 for (i=0; i<2; i++)
51 __asm__ volatile ("");
53 int ret = llf[i] (MAX, a, b);
55 if (ret != (MAX * 2) - 2 + i)
56 abort ();
58 #pragma GCC novector
59 for (i=0; i<MAX*2; i++)
61 __asm__ volatile ("");
62 if (b[i] != i + (i%2) + 1)
63 abort ();
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
69 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
70 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 2 "vect" } } */