From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id B4555385781F for ; Thu, 18 Mar 2021 15:05:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B4555385781F Received: by mail-ed1-x52d.google.com with SMTP id o19so7080564edc.3 for ; Thu, 18 Mar 2021 08:05:51 -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:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1wQw1T7enosrbxGaObuKutjITjZRmZqLY3kkkD7WzZc=; b=Gki7iEh7cqW9ryd/Vs9A0IN28R2e21MmgHhcfc8iRHD92uVwWlv/r3zgismBr4Spi+ qo9QjW4E94swrpDCv89fexTGZIFo2PhjIDTMhyC1nDmOAS7DV6uL4bzFu6/hmOpyoZxW fV7ynNUBaC10C7TeQfZkp/h76V6okOcXT2eLfMKeYmlr2tnba00QL8/N6n8DysA+1oMa Jr8R73Pfq/kfqjcrTCj5AJJkm9y2OHpT0n8egjswrWP0b6Z0DNiXFlN6wqWbhvxfEwkI ChhFtWX32/kIV4RmWCQEm85XapgnRYi1hgpVS3n+hXf7w7NMS7ZMrwYsMchwsdQsoZGJ 2tNw== X-Gm-Message-State: AOAM530rpUgU9AsS2StaWUuDBs27pK2P/mghi3apJe+7Peztyy+Nr6CL qjXnSyyPn8R9OfY4937FfhVwr+u2bItjZB2h3dA= X-Google-Smtp-Source: ABdhPJz22iFyaxD4GCpnCuUVUTmGMN09fZfYhImwArcSEQC7o+zAhNhwTj7N8Lr78CmmXbpdiTZjj5ZHLJATb0FjT4M= X-Received: by 2002:a05:6402:31b7:: with SMTP id dj23mr4283178edb.245.1616079950869; Thu, 18 Mar 2021 08:05:50 -0700 (PDT) MIME-Version: 1.0 References: <20210318074849.GA22541@troutmask.apl.washington.edu> <563cee48-fbcc-09bc-0cd1-f05082e4feb3@codesourcery.com> In-Reply-To: <563cee48-fbcc-09bc-0cd1-f05082e4feb3@codesourcery.com> From: Richard Biener Date: Thu, 18 Mar 2021 16:05:40 +0100 Message-ID: Subject: Re: MATMUL broken with frontend optimization. To: Tobias Burnus Cc: Steve Kargl , "fortran@gcc.gnu.org" , Thomas Koenig Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 15:05:53 -0000 On Thu, Mar 18, 2021 at 3:48 PM Tobias Burnus wro= te: > > Richard, > > On 18.03.21 13:35, Richard Biener via Fortran wrote: > > [...] > > Since the libgfortran MATMUL should be vectorized > > I think it's not reasonable to inline any but _very_ small > > MATMUL at optimization levels that do not enable vectorization. > > Besides the obvious if (!flag_external_blas) which should always prevent > inlining (possibly except for tiny N like N=3D1), your idea is 'if (N > small || flag_tree_loop_vectorize)'? > > Or are you thinking of a different or additional flag_... than > flag_tree_loop_vectorize for making this choice? Yes, I was thinking of flag_tree_loop_vectorize. Of course libgfortran is far from having micro-optimized matmul for various architectures but IIRC it uses attribute(target) to provide several overloads. So maybe only ever inlining tiny matmul makes sense as well (does the runtime have specializations for small sizes?) Richard. > Tobias > > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen= Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas= Heurung, Frank Th=C3=BCrauf