This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] PR32131: allocatable arrays have stride 1


Michael Matz wrote:
> Their lowest dimension always has stride 1, so adjusting 
> gfc_conv_descriptor_stride_get() is enough (on top of richis recent 
> improvements to alias disambiguation) to vectorize everything interesting 
> in leslie.  Its runtime drops from 960 to 823 seconds, 14% improvement.
>   
Impressive what a that small patch can do. Thanks for the patch.

> Okay for trunk?
>   
Yes, the patch is OK.

 * * *

I wonder whether one couldn't extend the patch to explicit shape,
automatic arrays and assumed-size arrays; here also the innermost
dimension should have stride=1. (For pointers and for nonallocatable
assumed-shape arrays, this assumption is moot.)

To do this, one would need to update trans.c's gfc_array_kind, which
currently only has GFC_ARRAY_UNKNOWN, GFC_ARRAY_ASSUMED_SHAPE,
GFC_ARRAY_POINTER; maybe adding a GFC_ARRAY_CONTIGUOUS would be best?

Tobias

PS: To other readers: If one passes an allocatable array as via
vector-section and strides as actual argument, then the dummy argument
cannot be allocatable. If it is allocatable, it must be contiguous as
one cannot allocate with strides; thus this patch should be save. (For
pointers, the world is different.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]