Transforming Loops

Hi all,

I need to transform loops like this one
for (int i = b; i<e; ++i) buffer[i];

into loops like this one:
for(p=buffer+b; p<buffer+e; ++p) *p;

Does any pass already perform this? If there's none, I guess loop-reduce is a good starting point for me, isn't it?

Thanks
Marc

I don't think any pass does this at the moment, but loop-reduce could
easily be extended to do something like that. Make sure you're using
trunk so you get SCEVs for pointers.

-Eli