From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122699 invoked by alias); 2 Jun 2019 15:09:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 122682 invoked by uid 89); 2 Jun 2019 15:09:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:ac2, HX-HELO:sk:mail-lf, H*f:sk:e8c57f4, H*i:sk:e8c57f4 X-HELO: mail-lf1-f65.google.com Received: from mail-lf1-f65.google.com (HELO mail-lf1-f65.google.com) (209.85.167.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Jun 2019 15:09:22 +0000 Received: by mail-lf1-f65.google.com with SMTP id q26so11602860lfc.3; Sun, 02 Jun 2019 08:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FkgO0VqLzR1cjcn0Tu+ldooMcZj6nay1Aa86F036K3A=; b=E9JNPX8YLloc4OHJAx3slTVC++0IL4uBXvUjYvZ4a+29PTIlYmMMP79sPXnODXJsp4 QM82CxfggMpsgMSt+xM5Zo89lkrDJ6aAk3SXSXinPERz7QVfCgZxkl7/f5zBT3Gzp64/ 8Gvv0VP2s3jDcVJLwT7tdsY7n/ceFnItvkk8bn78eIYQJ6nh47mOThXtzERpVid0PXu4 KWhlCUdsEQ+Z7IESnqJHfGr9ZHwmYGZDS6/Ck3P2vJ8wt+nBuxu1q380WpsXOiYNNVhA 0A/ujtmHR8NI0iyNdIXaaimiTu0I22pgjY1rfggB+dvI6DzukfsLSKyVewOnZYidj/ys STPA== MIME-Version: 1.0 References: In-Reply-To: From: Paul Richard Thomas Date: Sun, 02 Jun 2019 15:09:00 -0000 Message-ID: Subject: Re: [patch, fortran] Two tweaks to argument repacking To: Thomas Koenig Cc: "fortran@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-06/txt/msg00026.txt.bz2 Hi Thomas, It looks good to me. OK for trunk. Thanks Paul On Sun, 2 Jun 2019 at 14:34, Thomas Koenig 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 > > 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 > > 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