From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51466 invoked by alias); 23 Apr 2018 11:02:58 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 51454 invoked by uid 89); 23 Apr 2018 11:02:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=our, phone X-HELO: mail-lf0-f51.google.com Received: from mail-lf0-f51.google.com (HELO mail-lf0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 11:02:56 +0000 Received: by mail-lf0-f51.google.com with SMTP id p142-v6so14287761lfd.6 for ; Mon, 23 Apr 2018 04:02:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jDKU9PUzSbjs8XZKzvmM41rwinS5jaPJvyP9aUZ8Sg4=; b=EAHZxgpkQjFgaEVYDpXfoiuz4IUQCnmNmys2KsclqSMnb4/bemAvCjwcGHQWv6umj1 FzfwHVNNXKnWxWCeoicUm7NkdYIRil2HBuPZ6CHK3L/bOe+a4Yd64gcL3c4j4bmUI3GM 90UQcfySgE+SOoxnOSjDogebAfGc81+CuOo40ycFdCfIWGkD5h7JunYosU4rdMof0AfD 1L/EsD2Wftfx7g/9POtE1hXoveRHcJ+aigPmECr/AZ9MZ6XvaJ1A7moY1XN2uBK+4LQf swNxF9Xc4ZaVm7jAsepuhWHd4hw/TbWJUFGUC3Z2ZotT5rN+mPHoVyma+PmiduWmEhBt KAzw== X-Gm-Message-State: ALQs6tACM/2SGxvi24TED5Mvc3E10Ge3MZSfzccfoRdBUaavVFmX6oh8 jmJErbOBLbjUAeGOrKL95zWnTxWEMcbsxZH3n78= X-Google-Smtp-Source: AB8JxZq+cn+4YxSPKbN7sBDHPyFuPdZuCi3JNy4srnnOp2p8z0wsZFce2Mn/Uuvd/gnfdA8VpjdTCQhoTarR4VToMZU= X-Received: by 10.46.73.73 with SMTP id b9mr6000227ljd.118.1524481373969; Mon, 23 Apr 2018 04:02:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.101.151 with HTTP; Mon, 23 Apr 2018 04:02:53 -0700 (PDT) In-Reply-To: References: <71dd38d0-2dbc-0100-7419-6f1ca1d5e077@moene.org> From: Richard Biener Date: Mon, 23 Apr 2018 12:31:00 -0000 Message-ID: Subject: Re: Loop fusion. To: "Bin.Cheng" Cc: Toon Moene , gcc mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00137.txt.bz2 On Mon, Apr 23, 2018 at 12:59 PM, Bin.Cheng wrote: > On Sun, Apr 22, 2018 at 3:27 PM, Toon Moene wrote: >> A few days ago there was a rant on the Fortran Standardization Committee= 's >> e-mail list about Fortran's "whole array arithmetic" being unoptimizable. >> >> An example picked at random from our weather forecasting code: >> >> ZQICE(1:NPROMA,1:NFLEVG) =3D PGFL(1:NPROMA,1:NFLEVG,YI%MP) >> ZQLI(1:NPROMA,1:NFLEVG) =3D PGFL(1:NPROMA,1:NFLEVG,YL%MP) >> ZQRAIN(1:NPROMA,1:NFLEVG) =3D PGFL(1:NPROMA,1:NFLEVG,YR%MP) >> ZQSNOW(1:NPROMA,1:NFLEVG) =3D PGFL(1:NPROMA,1:NFLEVG,YS%MP) >> >> The reaction from one of the members of the committee (about "their" >> compiler): >> >> 'And multiple consecutive array statements with the same shape are =E2= =80=9Cfused=E2=80=9D >> exactly so that the compiler can generate good cache use. This sort of >> optimization is pretty low hanging fruit.' >> >> As far as I can see loop fusion as a stand-alone optimization is not >> supported as yet, although some mention is made in the context of graphi= te. >> >> Is this something that should be pursued ? > Hi, > I don't know the current status of fusion in graphite. As for > traditional fusion transformation, I think it's not very difficult to > be implemented along with existing distribution, actually, quite lot > of code should be shared. What we do need are something like: more > motivation cases, good/conservative cost model. Yes, I guess before distribution you want to do maximum fusion and then apply (re-)distribution on the fused loop. The cost model should be the very same for distribution/fusion. Richard. > Thanks, > bin >> >> Kind regards, >> >> -- >> Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 >> Saturnushof 14, 3738 XG Maartensdijk, The Netherlands >> At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ >> Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news