| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target vect_float } */ |
| 3 |
/* { dg-additional-options "-Ofast -funroll-loops" } */ |
| 4 |
|
| 5 |
#define NXX 516 |
| 6 |
#define NYY 516 |
| 7 |
#define IND(x,y) ((x) + (y)*NXX) |
| 8 |
float **In, **Out, **V; |
| 9 |
|
| 10 |
void foo(int I, int J, int K1, int K2, int L1, int L2 ) |
| 11 |
{ |
| 12 |
for(int i=0; i < I; i++) |
| 13 |
{ |
| 14 |
float *v = V[i]; |
| 15 |
|
| 16 |
for(int j=0; j < J; j++) |
| 17 |
{ |
| 18 |
float *in = In[j]; |
| 19 |
float *out = Out[j]; |
| 20 |
for(int l=L1; l<L2; l++) |
| 21 |
{ |
| 22 |
for(int k=K1; k<K2; k++) |
| 23 |
{ |
| 24 |
float sum = 0; |
| 25 |
int offset = 0; |
| 26 |
for(int m=-2; m<=2; m++) |
| 27 |
{ |
| 28 |
for(int n=-2; n<=2; n++, offset++) |
| 29 |
sum += in[IND((k+n), (l+m))] * v[offset]; |
| 30 |
} |
| 31 |
out[IND(k,l)] = sum; |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
/* { dg-final { scan-tree-dump "improved number of alias checks from \[0-9\]* to 2" "vect" } } */ |