Hello cloog users,
What option should be passed to cloog to generate merged loops? Suppose I have the following program (named 'merge_try.c'):
int main(void){
int n=100,m=50;
int i,j;
int x[n][m];
int y[n][m];
#pragma scop
for(i=0; i<n; i++)
for(j=0; j<m; j++)
x[i][j]=i-j;
for(i=0; i<n; i++)
for(j=0; j<m; j++)
y[i][j]=i+j;
#pragma endscop
}
I generate the .scop file using clan
$ clan merge_try.c > merge_try.scop
Now, I want to use cloog to generate the following loop:
for(i=0; i<n; i++)
for(j=0; j<m; j++)
x[i][j]=i-j;
y[i][j]=i+j;
Is it possible to generate the above loop using cloog? When I try:
$ cloog -openscop merge_try.scop
I get the following program as output, in which the loops are not merged:
/* Useful macros. */
#define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))
#define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))
#define max(x,y) ((x) > (y) ? (x) : (y))
#define min(x,y) ((x) < (y) ? (x) : (y))
int main(void){
int n=100,m=50;
int i,j;
int x[n][m];
int y[n][m];
#pragma scop
if ((m >= 1) && (n >= 1)) {
for (i=0;i<=n-1;i++) {
for (j=0;j<=m-1;j++) {
x[i][j]=(i)-(j);
}
}
for (i=0;i<=n-1;i++) {
for (j=0;j<=m-1;j++) {
y[i][j]=i+j;
}
}
}
#pragma endscop
}
Kindly help.
(I'm using CLooG 0.18.0 and clan 0.7.1 .)
Thanks,
Sourav