[patch, fortran] Create some temporary variables for matmul arguments

Thomas Koenig tkoenig@netcologne.de
Sun May 28 21:40:00 GMT 2017


Hello world,

the attached patch generates some more opportunities for matmul inlining
by creating temporaries if arguments overlap, if the return is from
a function or something similar.

With this, we are pretty much coming to the end of the matmul
optimization saga.  After this, on to new shores! :-)

Regression-testing turned up a few problems, which were fixed
(see ChangeLog).

OK for trunk?

Regards

	Thomas

2017-05-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37131
	* frontend-passes.c (check_conjg_transpose_variable):
	Add prototype.
	(has_dimen_vector_ref):  Likewise
	(matmul_temp_args):  New function. Add prototype.
	(optimize_namespace):  Call matmul_temp_args.

2017-05-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/37131
	* gfortran.dg/promotion_2.f90: Add -finline-matmul-limit=0 to
	flags.
	* gfortran.dg/transpose_optimization_1.f90: Likewise.
	* gfortran.dg/inline_matmul_17.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p5.diff
Type: text/x-patch
Size: 4535 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20170528/88e066ce/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_matmul_17.f90
Type: text/x-fortran
Size: 1421 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20170528/88e066ce/attachment-0001.bin>


More information about the Fortran mailing list