1 /* { dg-do compile } */
2 /* { dg-options "-fopenmp -fdump-tree-optimized -O3" } */
3
4 /* Test that functions that have SIMD clone counterparts are not
5 cloned by IPA-cp. For example, special_add() below has SIMD clones
6 created for it. However, if IPA-cp later decides to clone a
7 specialization of special_add(x, 666) when analyzing fillit(), we
8 will forever keep the vectorizer from using the SIMD versions of
9 special_add in a loop.
10
11 If IPA-CP gets taught how to adjust the SIMD clones as well, this
12 test could be removed. */
13
14 #pragma omp declare simd simdlen(4)
15 static int __attribute__ ((noinline))
special_add(int x,int y)16 special_add (int x, int y)
17 {
18 if (y == 666)
19 return x + y + 123;
20 else
21 return x + y;
22 }
23
fillit(int * tot)24 void fillit(int *tot)
25 {
26 int i;
27
28 for (i=0; i < 10000; ++i)
29 tot[i] = special_add (i, 666);
30 }
31
32 /* { dg-final { scan-tree-dump-not "special_add.constprop" "optimized" } } */
33 /* { dg-final { cleanup-tree-dump "optimized" } } */
34