This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Matrix Flattening optimization


Daniel Jacobowitz <drow@false.org> wrote on 02/03/2006 19:48:43:

> Just to clarify:
> 
> On Thu, Mar 02, 2006 at 12:43:54PM -0500, Daniel Berlin wrote:
> > I'd imagine fortran programs would find it useful as well, as do a lot
> > of floating point array intensive apps. The fact that it helps equake 
is
> > not some well known hack, it's just from getting better locality, 
AFAIK.
> 
> I know this, which is why I what I was trying to ask was...
> 
> > In general, combining malloc calls and hoisting them out of loops is a
> > win, if you couldn't vectorize or interchange the original loop (due 
to
> > dependences, etc).
> 
> ...whether this occured often enough in Real Code to bother.
> 
> How would Fortran programs find it useful?  Shouldn't the Fortran
> compiler be generating the array flat in the first place?
> 

The optimization, in the current stage, indeed isn't useful for Fortran 
programs, as the Fortran 
compiler generates a flattened array. 
However, the flattening of the multi dimensional matrix can be performed 
in several ways.
For instance, for a two dimensional array, the layout could be row after 
row, or column after column.
Based on profiling information, we'll decide which layout is the most 
profitable.
Flattening optimization (in the more general sense, explained above) could 
be then beneficial
also for Fortran.

Razya


> -- 
> Daniel Jacobowitz
> CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]