| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-slp2-details -msse2" } */ |
| 3 |
|
| 4 |
int x[4]; |
| 5 |
void foo(int i) |
| 6 |
{ |
| 7 |
int j = (i+1) & 31; |
| 8 |
x[0] = (x[0] << j) + j; |
| 9 |
x[1] = (x[1] << j) + j; |
| 10 |
x[2] = (x[2] << j) + j; |
| 11 |
x[3] = (x[3] << j) + j; |
| 12 |
} |
| 13 |
|
| 14 |
/* We should not use vector operations for i + 1 and (i + 1) & 31 but |
| 15 |
instead use { j, j, j, j }. */ |
| 16 |
/* { dg-final { scan-tree-dump-times "Using a splat of the uniform operand" 2 "slp2" } } */ |
| 17 |
/* { dg-final { scan-tree-dump-not " = \{i_" "slp2" } } */ |
| 18 |
/* { dg-final { scan-tree-dump-times " = \{j_" 1 "slp2" } } */ |