| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-ifcvt-details-blocks-details" } */ |
| 3 |
|
| 4 |
void foo (int *x1, int *x2, int *x3, int *x4, int *y) |
| 5 |
{ |
| 6 |
int i; |
| 7 |
int a1, a2, a3, b1, b2; |
| 8 |
|
| 9 |
for (i=0; i<128; i++) |
| 10 |
{ |
| 11 |
a1 = x1[i]; |
| 12 |
a2 = x2[i]; |
| 13 |
a3 = x3[i]; |
| 14 |
y[i] = 0; |
| 15 |
if (x4[i] == 0) |
| 16 |
{ |
| 17 |
b1 = a1 + 1; |
| 18 |
if (a2 > 0) |
| 19 |
b1++; |
| 20 |
a1++; |
| 21 |
if (a3 < 0) |
| 22 |
b1--; |
| 23 |
y[i] = b1; |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-tree-dump-times "Use predicate of bb" 4 "ifcvt" } } */ |
| 29 |
|
| 30 |
/* We insert into code |
| 31 |
if (LOOP_VECTORIZED (...)) |
| 32 |
which is folded by vectorizer. Both outgoing edges must have probability |
| 33 |
100% so the resulting profile match after folding. */ |
| 34 |
/* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */ |
| 35 |
/* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */ |