From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50012 invoked by alias); 21 Nov 2019 12:16:35 -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 49996 invoked by uid 89); 21 Nov 2019 12:16:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:4ecba99, H*i:sk:4ecba99, H*RU:209.85.167.65, HX-Spam-Relays-External:209.85.167.65 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; Thu, 21 Nov 2019 12:16:33 +0000 Received: by mail-lf1-f65.google.com with SMTP id 203so2420363lfa.12; Thu, 21 Nov 2019 04:16:32 -0800 (PST) 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:content-transfer-encoding; bh=WbQbdD/Hn96TmpZ50XiiqkewkpDFmDHFltzfwR5LX8Q=; b=n7pX/tjttOYjGP9qM5bxWBn439lLIkTv1o1qA99uitdD6JQ+NtJRNiqoqapAAIOrGN kop3GLMOB7UXC4DGUoHox8XGHnQ8OzDiX/RyFPNue2P0QjJHKpJF9hGimf3Xrk+bxx+2 UFyuFPIIrwaJEhOFp7UoT1lgSbaNGwgQnxlvfyhMkvuPvaWUK4IXqclsjU7554Kx0u3x CsV6kZKunsJIcAD0vmtkxyK/Nd6EoDN8WnoRMUcws2VLHCQ8WPY3hzI5xNcg+0rhhVME hQLb5GkdGuitRhWeNhnJ8rAV5jeK8sgbQli2Au4/dj0ai7vlooAGf/9EpCu5PO22QWBt bPCA== MIME-Version: 1.0 References: <48286910-ebbb-10e4-488b-8c96e505375c@tkoenig.net> <43b9fcf0-f457-90a7-c807-4aebc65cb045@tkoenig.net> <2981fd67-007e-7327-8208-27e8fd18d9db@netcologne.de> <4e68f250-1e41-ac7c-dc64-88f91cdf183e@tkoenig.net> <4ecba99c-f63a-628c-0778-d651503f7aa6@codesourcery.com> In-Reply-To: <4ecba99c-f63a-628c-0778-d651503f7aa6@codesourcery.com> From: Richard Biener Date: Thu, 21 Nov 2019 12:30:00 -0000 Message-ID: Subject: Re: [patch, fortran] Load scalar intent-in variables at the beginning of procedures To: Tobias Burnus Cc: =?UTF-8?Q?Thomas_K=C3=B6nig?= , Janne Blomqvist , Thomas Koenig , "fortran@gcc.gnu.org" , gcc-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg02093.txt.bz2 On Thu, Nov 21, 2019 at 10:35 AM Tobias Burnus wr= ote: > > On 11/20/19 10:35 PM, Thomas K=C3=B6nig wrote: > >> Is there a risk of performance regressions due to higher register > >> pressure? > > richi points out (on IRC) that ideally LTO IPA opts would promote the > call-by reference to call-by value =E2=80=93 but is not sure that it inde= ed > happens. [In any case, Linux distros have started to compile packages > with LTO.] > > One could try and see whether that indeed happens. =E2=80=93 Still, I thi= nk the > real solution is to teach the middle end about the Fortran semantics. OK, so I found it, it's handled via SSA_NAME_POINTS_TO_READONLY_MEMORY which is initialized during the rewrite into SSA form from the information given by the "fn spec" attribute: for (tree arg =3D DECL_ARGUMENTS (cfun->decl); arg; arg =3D DECL_CHAIN (arg), ++i) { if (i >=3D (unsigned) TREE_STRING_LENGTH (fnspec)) break; if (TREE_STRING_POINTER (fnspec)[i] =3D=3D 'R' || TREE_STRING_POINTER (fnspec)[i] =3D=3D 'r') so when the frontend sets "fn spec" from the intent it should already work. But the examples I saw above didn't use INTENT(IN) for the scalar parameter= s. Richard. > Cheers, > > Tobia > >