From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7341 invoked by alias); 23 Apr 2018 10:59:39 -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 7330 invoked by uid 89); 23 Apr 2018 10:59:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=netherlands, Netherlands, weather, committees X-HELO: mail-io0-f171.google.com Received: from mail-io0-f171.google.com (HELO mail-io0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Apr 2018 10:59:36 +0000 Received: by mail-io0-f171.google.com with SMTP id e78-v6so5356100iod.0 for ; Mon, 23 Apr 2018 03:59:36 -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=3uXFt0/TThT7m1cJ0UejmoGFohbjrtodyfLbhaU5U5c=; b=DsqD53MgWdExc0h2BY6IfbZctGAkHj7fj+uFbNNNx8/9dmnsqzGaMaHOZ/7I2Iwjsw 8LhlyEVhvWvEjFK/xUMV7M/lOhW8eH9sLoPouxJp0C00H1iYuLHANgJzb0Xkbpdh04We RKs0rZHEcKkWW1UNRmdP+P1/XdOYD8YcP79MGXSAlAnleez7bPoZm7RLh9yiq6QG59Gr T8BVMiblxcHdoGVVTOTJXPX4RHFK/mflXiGIM7NDxQvonFx70n3CBbDAV5rjPIPFA86a sn+d34F+LCoG/FkwR6DgX5W1GeyXSEfeNRkeCwLEUuhwp9upO0BO2hnpDBLT7x6UkUa5 FymQ== X-Gm-Message-State: ALQs6tCzuDQsMY8xdZKQgMVJ86ov0DAexLeCQKqreXyJUD6v6Zh9xThP oGJSIk4A++HlzIsyXrlHxNWwsQHgxhGWbe2WKaQ= X-Google-Smtp-Source: AB8JxZqZR+xv09opefuXAY36J+gAIJFrglBu17bsE34skhQrwmB70eq8cgHUH5TJHOj6p6QKaGpxWjDlyrpbWRIVQzU= X-Received: by 2002:a6b:1110:: with SMTP id z16-v6mr19769739ioi.248.1524481175098; Mon, 23 Apr 2018 03:59:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:b40e:0:0:0:0:0 with HTTP; Mon, 23 Apr 2018 03:59:34 -0700 (PDT) In-Reply-To: <71dd38d0-2dbc-0100-7419-6f1ca1d5e077@moene.org> References: <71dd38d0-2dbc-0100-7419-6f1ca1d5e077@moene.org> From: "Bin.Cheng" Date: Mon, 23 Apr 2018 11:00:00 -0000 Message-ID: Subject: Re: Loop fusion. To: Toon Moene Cc: gcc mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00135.txt.bz2 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 graphit= e. > > 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. 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