IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-reduc-5.c
blob0974b6642d831ec8a20965874003eaeb74901fa2
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include <stdio.h>
5 #include "tree-vect.h"
7 #define N 128
9 int c[N];
11 /* Vectorization of reduction using loop-aware SLP. */
13 __attribute__ ((noinline))
14 int main1 (int n, int res0, int res1)
16 int i;
17 int max0 = -100, max1 = -313;
19 for (i = 0; i < n; i++) {
20 max1 = max1 < c[2*i+1] ? c[2*i+1] : max1;
21 max0 = max0 < c[2*i] ? c[2*i] : max0;
24 /* Check results: */
25 if (max0 != res0
26 || max1 != res1)
27 abort ();
29 return 0;
32 int main (void)
34 int i;
36 check_vect ();
38 for (i = 0; i < N; i++)
39 c[i] = (i+3) * -1;
41 c[0] = c[1] = -100;
42 main1 (N/2, -5, -6);
43 return 0;
46 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_int_max } } } */
47 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_max } } } */
48 /* { dg-final { cleanup-tree-dump "vect" } } */