1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-all" } */
4 void foo (int * __restrict__ ia
,
6 int * __restrict__ oxa
,
7 int * __restrict__ oxb
,
8 int * __restrict__ oya
,
9 int * __restrict__ oyb
)
15 for (i
=0; i
< 52; i
++)
17 mya
[i
] = ia
[i
] * oxa
[i
] + ib
[i
] * oxb
[i
];
18 myb
[i
] = -ia
[i
] * oxb
[i
] + ib
[i
] * oxa
[i
];
20 oyb
[i
] = myb
[i
] >> 10;
23 /* This loop should be distributed, and the result should look like
25 | memset (oya, 0, 208);
26 | for (i=0; i < 52; i++)
27 | oyb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i] >> 10;
31 /* { dg-final { scan-tree-dump-times "distributed: split to 1 loops and 1 library calls" 1 "ldist" } } */
32 /* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */