Re: [patch, fortran] Inline MATMUL(TRANSPOSE(A),B) for rank 1 B.

Jerry DeLisle <[email protected]> Sat, 1 Aug 2026 07:50:41 -0700
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>

On 8/1/26 1:48 AM, Thomas Koenig wrote:
> Hello world,
> 
> what it says in the ChangeLog. Regression-tested. OK for trunk?

OK Thomas, thanks.

Jerry

> 
> Best regards
> 
>      Thomas
> 
> Inline MATMUL(TRANSPOSE(A),B) for rank 1 B.
> 
> This patch implements inlining MATMUL(TRANSPOSE(A),B).  For ordering
> of the loops, this is an unpleasant problem because of the dependence
> of c(i) on the previous iteration, but gcc was able to fully unroll
> the loops at least for small sizes, and the version in the patch generated
> better code.
> 
> gcc/fortran/ChangeLog:
> 
>      * frontend-passes.cc (enum matrix_case): Add case A2TB1.
>      (matmul_lhs_realloc): Add condition for reallocation and
>      size checks.
>      (inline_matmul_assign): Handle A2TB1.
> 
> gcc/testsuite/ChangeLog:
> 
>      * gfortran.dg/inline_matmul_29.f90: New test.
>