
On 14/06/11 16:38, David A. Greene wrote:
Mathias Gaunard<mathias.gaunard@ens-lyon.org> writes:
We generate something along the lines of
float tmp = 0.f; for(int i ....) tmp += d[i] + e[i];
for(int i ...) f[i] = b[i] + 3 * c[i] + tmp;
Will NT2 fuse the loops to get rid of the temporary? Does it do strip-mining or other such things (beyond that needed for vectorization)? Does NT2 try to generate a loop nest with the appropriate loops interchanged to improve performance?
If loop size is deductible at compile time (and nt2 container support such hints) yes. As for the rest, loop interchange could be either deduced if some compile-hints are given or extracted but it usually requires some semantic driven approach to this, aka the type of the container will have hints on how to evaluates its instances properly.