1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
4 void foo (int * __restrict__ a,
10 for (i=1; i < 10; i++)
16 /* This loop is not distributed because the cost of spliting it:
18 | for (i=1; i < N; i++)
21 | for (i=1; i < N; i++)
22 | b[i] = a[i - 1] + 1;
24 is higher due to data in array A that is written and then read in
25 another task. The cost model should forbid the transformation in
30 /* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
31 /* { dg-final { cleanup-tree-dump "ldist" } } */