This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch, fortran] [0/11] Inline transpose part 1
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 04 Sep 2010 16:16:00 +0200
- Subject: [Patch, fortran] [0/11] Inline transpose part 1
Hello,
this patch serie implements inlining transpose, in other words,
transpose as a scalarizer thing.
* In the current implementation *
for an array reference like a(1,2,:,3,:), the scalarizer info is filled
along the 3th and 5th dimensions, and the dim array holds the value
{2,4} (index starts at 0).
Then, transpose(a(1,2,:,3,:)) has a completely new scalarizer info
filled along the 1st and 2nd dimensions, the dim array holding the value
{0,1}. At trans stage, there is a trick to create a descriptor with
exchanged strides, so that the descriptor's 1st dimension will actually
access the array's 2nd dimension (or the 5th of `a' in the case above)
and vice versa.
* What the patch does *
is evaluate transpose(a(...)) as a(...) itself, with the scalarizer's
dim exchanged ({4,2} instead of {2,4} in the case above).
This breaks some assumptions in the code and leads to various unrelated
regression, which are fixed by the patches 3..9 and 11. The actual patch
is the 10th.
The good thing:
With the patches transpose(a+b) is handled without a temporary for (a + b).
The bad thing:
With the patches function(transpose(a)) needs a temporary for
transpose(a) which was not needed before. This is due to the trans stage
trick which is gone, and will have to come back save us in
gfc_conv_expr_descriptor: this is the point of the inline transpose part
2 patch serie (to come).
The patches were tested one by one on an older revision, and only all
together recently. No regression. I will ask for committal on trunk for
every of them.
Mikael
- Follow-Ups:
- [Patch, fortran] [1/11] Inline transpose part 1
- [Patch, fortran] [2/11] Inline transpose part 1
- [Patch, fortran] [3/11] Inline transpose part 1
- [Patch, fortran] [4/11] Inline transpose part 1
- [Patch, fortran] [5/11] Inline transpose part 1
- [Patch, fortran] [6/11] Inline transpose part 1
- [Patch, fortran] [7/11] Inline transpose part 1
- Re: [Patch, fortran] [0/11] Inline transpose part 1
- [Patch, fortran] [9/11] Inline transpose part 1
- [Patch, fortran] [10/11] Inline transpose part 1
- [Patch, fortran] [0/11] Inline transpose part 1
- Re: [Patch, fortran] [0/11] Inline transpose part 1
- Re: [Patch, fortran] [0/11] Inline transpose part 1
- Re: [Patch, fortran] [0/11] Inline transpose part 1