[patch, fortran] Create temporary variables for matmul

Markus Trippelsdorf markus@trippelsdorf.de
Tue May 9 07:28:00 GMT 2017


On 2017.05.08 at 10:40 -0700, Jerry DeLisle wrote:
> On 05/07/2017 03:18 AM, Thomas Koenig wrote:
> > Hello world,
> > 
> > the attached patch goes one step further in matmul inlinding.
> > 
> > It converts statements like
> > 
> >   r = dot_product(matmul(a2,v1),v2)
> > 
> > into
> > 
> >   tmp = matmul(a2,v1)
> >   r = dot_product(tmp,v2)
> > 
> > to enable inlining of matmul (but only if inlining
> > is active, of course).
> > 
> > In order to detect multiple uses of matmul, this is run
> > several times.  I did this because, with the current
> > implementation, create_var can fail if -fno-realloc-lhs
> > is specified.  This is also not optimal, but that's a bug
> > for another day, and I don't see any drawbacks in
> > code generation for this (the extra basic blocks will
> > be removed).
> > 
> > The actual overhead in the case of non-constant bounds should
> > be small to non-existent, this only replaces one type of
> > temporary with another.
> > 
> > I had to adjust some test cases which counted things to use
> > the library version.
> > 
> > Regression-tested.  OK for trunk?
> > 
> 
> OK. Could you post some before and after performance results. Intuitively this
> makes sense to do, but empirically does it pay off.

178.galgel now fails for 32 bit machines, e.g. 
https://gcc.gnu.org/ml/gcc-regression/2017-05/msg00180.html

-- 
Markus



More information about the Fortran mailing list