Hi Thomas, It looks good to me. OK for trunk.
Thanks Paul On Sun, 2 Jun 2019 at 14:34, Thomas Koenig <tkoe...@netcologne.de> wrote: > > Hello world, > > this patch adds two tweaks to the argument repacking. > > First, when the size of an argument is known to be one, as in a(n1:n1), > we can directly pass a pointer - the stride may not be one, but it > does not matter. > > Second, the case where the array passed is actually contiguous is > more likely in practice, so it should get the fast path. I have > done this by defining a new predictor and setting the estimated > likelyhood at 75%, which ensured a path without jumps when the > arguments passed to bar were contiguous: > > module y > contains > subroutine bar(a,b) > real, dimension(:) :: a,b > call foo(a,b,size(a)) > end subroutine bar > end module y > > Test case is only for the first part - making one for the second > part would have been a bit too much. > > Regression-tested. OK for trunk? > > Regards > > Thomas > > 2019-06-02 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/90539 > * trans-expr.c (gfc_conv_subref_array_arg): If the size of the > expression can be determined to be one, treat it as contiguous. > Set likelyhood of presence of an actual argument according to > PRED_FORTRAN_ABSENT_DUMMY and likelyhood of being contiguous > according to PRED_FORTRAN_CONTIGUOUS. > > 2019-06-02 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/90539 > * predict.def (PRED_FORTRAN_CONTIGUOUS): New predictor. -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein