[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-05-14 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

Thomas Koenig  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Thomas Koenig  2011-05-14 
09:50:46 UTC ---
Fixed on trunk.

Closing.


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-05-14 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

--- Comment #8 from Thomas Koenig  2011-05-14 
09:48:11 UTC ---
Author: tkoenig
Date: Sat May 14 09:48:08 2011
New Revision: 173752

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173752
Log:
2011-05-14  Thomas Koenig  

PR fortran/22572
* frontend-passes.c (cfe_register_funcs):  Also register functions
for potential elimination if the rank is > 0, the shape is unknown
and reallocate on assignment is active.
(create_var):  For rank > 0 functions with unknown shape, create
an allocatable temporary.

2011-05-14  Thomas Koenig  

PR fortran/22572
* function_optimize_7.f90:  New test case.


Added:
trunk/gcc/testsuite/gfortran.dg/function_optimize_7.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/frontend-passes.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-04-22 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

--- Comment #7 from Thomas Koenig  2011-04-22 
15:57:01 UTC ---
We should generate

function optmatmul (a, b, c, m, n, count)
  implicit none  
  integer, intent(in) :: m, n, count
  double precision :: optmatmul(m, n)  
  double precision, intent(in) :: a(m, count), b(count, n), c(m, n)
  block
double precision, dimension(size(a,1), size(b,2)) :: tmp
tmp = matmul(a,b)
optmatmul = tmp / (1 + tmp)
  end block
end function optmatmul  

I forsee lots of special-casing here...


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-03-21 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

--- Comment #6 from Thomas Koenig  2011-03-21 
07:14:46 UTC ---
Author: tkoenig
Date: Mon Mar 21 07:14:42 2011
New Revision: 171207

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171207
Log:
2010-03-21  Thomas Koenig  

PR fortran/22572
* gfortran.h (gfc_option_t) : Add
flag_aggressive_function_elimination.
(gfc_dep_compare_functions):  Add prototype.
* lang.opt: Add faggressive-function-elimination.
* invoke.texi: Document -faggressive-function-elimination.
* frontend_passes (expr_array):  New static variable.
(expr_size):  Likewise.
(expr_count):  Likewise.
(current_code):  Likewise.
(current_ns):  Likewise.
(gfc_run_passes):  Allocate and free space for expressions.
(cfe_register_funcs):  New function.
(create_var):  New function.
(cfc_expr_0):  New function.
(cfe_code):  New function.
(optimize_namespace):  Invoke gfc_code_walker with cfe_code
and cfe_expr_0.
* dependency.c (gfc_dep_compare_functions):  New function.
(gfc_dep_compare_expr):  Use it.
* options.c (gfc_init_options):  Handle
flag_aggressive_function_elimination.
(gfc_handle_option):  Likewise.

2010-03-21  Thomas Koenig  

PR fortran/22572
* gfortran.dg/function_optimize_1.f90:  New test.
* gfortran.dg/function_optimize_2.f90:  New test.


Added:
trunk/gcc/testsuite/gfortran.dg/function_optimize_1.f90
trunk/gcc/testsuite/gfortran.dg/function_optimize_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/dependency.c
trunk/gcc/fortran/frontend-passes.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/invoke.texi
trunk/gcc/fortran/lang.opt
trunk/gcc/fortran/options.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-03-07 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

Tobias Burnus  changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #5 from Tobias Burnus  2011-03-08 
07:19:40 UTC ---
Definitely after 4.6 (which presumably branched this week). As it is only a
missed optimization, I would not even back port it.

Otherwise: Nice patch!


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-03-07 Thread jvdelisle at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot
   ||gnu.org

--- Comment #4 from Jerry DeLisle  2011-03-08 
03:14:18 UTC ---
I think this is too close to 4.6 release, but definitely 4.7 and then with some
time, a possible backport to 4.6.  If others feel it is safe, please say so.


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-03-07 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

Thomas Koenig  changed:

   What|Removed |Added

  Attachment #23575|0   |1
is obsolete||

--- Comment #3 from Thomas Koenig  2011-03-07 
21:02:49 UTC ---
Created attachment 23577
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23577
Updated patch

This one doesn't cause any regressions.


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2011-03-07 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572

Thomas Koenig  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |tkoenig at gcc dot gnu.org
   |gnu.org |

--- Comment #2 from Thomas Koenig  2011-03-07 
19:55:25 UTC ---
Created attachment 23575
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23575
proposed patch (partial)

Here is a patch which optimizes the case for arguments of
matmul which have known sizes at compile time.


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2005-07-20 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-21 
05:08 ---
Confirmed.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Last reconfirmed|-00-00 00:00:00 |2005-07-21 05:08:29
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2005-07-20 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

   Keywords||missed-optimization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572


[Bug fortran/22572] Double occurrence of matmul intrinsic not optimised

2005-07-20 Thread schnetter at aei dot mpg dot de


-- 
   What|Removed |Added

   Severity|normal  |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22572