IVOPT performance tuning patch. The main problem is a variant of maximal weight
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-62.c
blob724b646fde41a652e16c83042cebaebdc649dff7
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 __attribute__ ((noinline))
9 int main1 ()
11 int i, j;
12 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13 int ia[N][4][N+8];
15 /* Multidimensional array. Aligned. The "inner" dimensions
16 are invariant in the inner loop. Store. */
17 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
21 ia[i][1][j+8] = ib[i];
25 /* check results: */
26 for (i = 0; i < N; i++)
28 for (j = 0; j < N; j++)
30 if (ia[i][1][j+8] != ib[i])
31 abort();
35 /* Multidimensional array. Aligned. The "inner" dimensions
36 are invariant in the inner loop. Vectorizable, but the
37 vectorizer detects that everything is invariant and that
38 the loop is better left untouched. (it should be optimized away). */
39 for (i = 0; i < N; i++)
41 for (j = 0; j < N; j++)
43 ia[i][1][8] = ib[i];
47 /* check results: */
48 for (i = 0; i < N; i++)
50 for (j = 0; j < N; j++)
52 if (ia[i][1][8] != ib[i])
53 abort();
58 return 0;
61 int main (void)
63 check_vect ();
65 return main1 ();
68 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
69 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
70 /* { dg-final { cleanup-tree-dump "vect" } } */