annotate gcc/testsuite/gcc.dg/tree-ssa/ldist-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target int32plus } } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 int loop1 (int k)
kono
parents:
diff changeset
5 {
kono
parents:
diff changeset
6 unsigned int i;
kono
parents:
diff changeset
7 int a[10000], b[10000], c[10000], d[10000];
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 a[0] = k; a[3] = k*2;
kono
parents:
diff changeset
10 c[1] = k+1;
kono
parents:
diff changeset
11 for (i = 2; i < (10000-1); i ++)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 a[i] = k * i; /* S1 */
kono
parents:
diff changeset
14 b[i] = a[i-2] + k; /* S2 */
kono
parents:
diff changeset
15 c[i] = b[i] + a[i+1]; /* S3 */
kono
parents:
diff changeset
16 d[i] = c[i-1] + k + i; /* S4 */
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18 /*
kono
parents:
diff changeset
19 Dependences:
kono
parents:
diff changeset
20 S1 -> S2 (flow, level 1)
kono
parents:
diff changeset
21 S1 -> S3 (anti, level 1)
kono
parents:
diff changeset
22 S2 -> S3 (flow, level 0)
kono
parents:
diff changeset
23 S3 -> S4 (flow, level 1)
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 There are three partitions: {S1, S3}, {S2} and {S4}.
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 The cost model should fuse together all the partitions, as they
kono
parents:
diff changeset
28 are reusing the same data, ending on a single partition.
kono
parents:
diff changeset
29 */
kono
parents:
diff changeset
30 return a[10000-2] + b[10000-1] + c[10000-2] + d[10000-2];
kono
parents:
diff changeset
31 }
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 /* { dg-final { scan-tree-dump-times "distributed: split to 3 loops" 0 "ldist" } } */