[Patch, fortran] Use initial array dimensions in the scalarizer

Daniel Kraft d@domob.eu
Fri Jul 16 11:00:00 GMT 2010


Hi Mikael,

Mikael Morin wrote:
> Hello,
> 
> The scalarizer in its current state uses the dimen first fields of 
> gfc_ss_info's start, stride, etc arrays, where dimen is the dimension of 
> the scalarized expression.
> In order to handle reduced expressions (sum, product, etc), the 
> scalarizer will have to work at two levels: the full level, where all 
> the dimensions of the initial array are present, and the reduced level
> with only the dimensions left after reduction.
> To achieve this without inserting/removing/carrying around bounds and 
> the associated bookkeeping, we need sparse bounds arrays accessed 
> through the final (full) array dimension.
> 
> As gfc_ss_info already holds a dim array holding the final array 
> dimension, there is little work to do. We just need to make sure that we 
> index the bound arrays by that dimension.
> 
> That's what the attached patch does.
> The parts it changes are to be changed again as the data structure have
> to be reorganized, but it makes those changes more systematic.
> 
> Regression tested on x86_64-unknown-freebsd8.0. OK for trunk ?

Ok.

Just one question:

-	  info->delta[n] = gfc_evaluate_now (loop->from[n], &loop->pre);
+	  info->delta[dim] = gfc_evaluate_now (loop->from[n], &loop->pre);

Is it ok that loop->from remains indexed by n?

Thanks for the patch!

Daniel



More information about the Gcc-patches mailing list