Hi,
I wonder how many of you are familiar with scalar evolution pass. I met a
problem regarding to the SCEVAddRecExpr. Say for the code:
const int N = 100;
int a[N];
for(int i=0;i<N;i++) a[i] = 0;
For the access of a[i], the pass will transform this a[i] to a
SCEVAddRecExpr <@a, +, sizeof(int)><BB_Name>, which means the access of the
array `a' starts from the address `a' and has an access stride of
`sizeof(int)'.
However, when this code is slightly modified:
const int N=100;
int a[N];
int i;
for(i=0;i<N-1; i++) {}
a[i] = 0;
So the loop is empty and there's an access of `a[i]' (actually a[99] in this
case), this a[i] will still be transformed into the same SCEVAddRecExpr as
above. This does not really seem to make sense to me because the access
pattern is not really so at all. Is is a small bug in this tool? Thank you!