| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Ofast -fdump-tree-ifcvt-stats-blocks-details" } */ |
| 3 |
/* { dg-require-visibility "" } */ |
| 4 |
|
| 5 |
int a[1024] = {0.0}; |
| 6 |
int b[1024] = {0.0}; |
| 7 |
int c[1024] = {0.0}; |
| 8 |
int foo (float *x) |
| 9 |
{ |
| 10 |
int i = 0; |
| 11 |
|
| 12 |
for (i = 0; i < 1024; i++) |
| 13 |
{ |
| 14 |
c[i] = (x[i] > 0.0) ? a[i] : b[i]; |
| 15 |
} |
| 16 |
|
| 17 |
return 0; |
| 18 |
} |
| 19 |
|
| 20 |
/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */ |
| 21 |
|
| 22 |
/* We insert into code |
| 23 |
if (LOOP_VECTORIZED (...)) |
| 24 |
which is folded by vectorizer. Both outgoing edges must have probability |
| 25 |
100% so the resulting profile match after folding. */ |
| 26 |
/* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ |
| 27 |
/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ |