From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 28D773858C31 for ; Fri, 15 Dec 2023 09:46:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 28D773858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 28D773858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702633592; cv=none; b=l+xw2zef/EH/RT5bqeYFlO9fVn5A3XgAH/cp+xrsFUpT94p0AhASY1P8dC2aEu63NecHqBZnAeu7Dc7pjWbKAfIG3I9EhOZIOR/pndmXPMyKVoHctzQ+W9f4ntT3lO6soCP4Nn3EMsGGexKr0sSsHqlL0EuAWmiWlHnSY44Ln2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702633592; c=relaxed/simple; bh=aqHGUFEx1LWb0Rv5uYtmPCCm2NTSDlOTkJ2KnGViILQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=iAdwTJcyor4s0w55U46xp3D+lQ+32pGFWSMDiCo6ONTs23SrHNq9SDPArTFYtDa/bGqw23H2L8KGajdJ6E5d84GpTT4yFcx+ZHmiOcIvqiW/q0ijxUP3tBbtZq0AcrDSrZa05zjV9kmj+10V3zUvlWV7qtiGFAQmDJEEDCqZz4Y= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: /YsNX57qR1quNJ8k2KuKnQ== X-CSE-MsgGUID: nOwzUNccT+2G63pSoHxmKQ== X-IronPort-AV: E=Sophos;i="6.04,278,1695715200"; d="scan'208,223";a="25354265" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Dec 2023 01:46:29 -0800 IronPort-SDR: lo7HrceE7I84HbJfeOmNPgjvsi9ZMcFclkYXrByh6Fj1Z681E4B4M+yyaHmXuyVito6S+hkKjw G3pPPT7apGoppeNG1wHI2wKfqCqBMv2VLeQdW5GitqV3vNWGliWjodZ0t623/tB0B30AXH0VQw Rxmx8OGTolbo9Il+2uYAN5kPteakNKIxeC2amiowJXntntVZk0hOgHhQB+TpterWHptUTQbYTD LBi4BPiMADYG+mxQ9LczoVyHTE1CTk987dVzTjbEOQF5xSNO0sj1vgaoollU22KTtmpDxRWIj6 V74= From: Thomas Schwinge To: Di Zhao OS , CC: Richard Biener Subject: RE: [PATCH v4] [tree-optimization/110279] Consider FMA in get_reassociation_width In-Reply-To: References: User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 15 Dec 2023 10:46:21 +0100 Message-ID: <87a5qb4x3m.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2023-12-13T08:14:28+0000, Di Zhao OS wro= te: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/pr110279-2.c > @@ -0,0 +1,41 @@ > +/* PR tree-optimization/110279 */ > +/* { dg-do compile } */ > +/* { dg-options "-Ofast --param tree-reassoc-width=3D4 --param fully-pip= elined-fma=3D1 -fdump-tree-reassoc2-details -fdump-tree-optimized" } */ > +/* { dg-additional-options "-march=3Darmv8.2-a" { target aarch64-*-* } }= */ > + > +#define LOOP_COUNT 800000000 > +typedef double data_e; > + > +#include > + > +__attribute_noinline__ data_e > +foo (data_e in) Pushed to master branch commit 91e9e8faea4086b3b8aef2355fc12c1559d425f6 "Fix 'gcc.dg/pr110279-2.c' syntax error due to '__attribute_noinline__'", see attached. However: > +{ > + data_e a1, a2, a3, a4; > + data_e tmp, result =3D 0; > + a1 =3D in + 0.1; > + a2 =3D in * 0.1; > + a3 =3D in + 0.01; > + a4 =3D in * 0.59; > + > + data_e result2 =3D 0; > + > + for (int ic =3D 0; ic < LOOP_COUNT; ic++) > + { > + /* Test that a complete FMA chain with length=3D4 is not broken. = */ > + tmp =3D a1 + a2 * a2 + a3 * a3 + a4 * a4 ; > + result +=3D tmp - ic; > + result2 =3D result2 / 2 - tmp; > + > + a1 +=3D 0.91; > + a2 +=3D 0.1; > + a3 -=3D 0.01; > + a4 -=3D 0.89; > + > + } > + > + return result + result2; > +} > + > +/* { dg-final { scan-tree-dump-not "was chosen for reassociation" "reass= oc2"} } */ > +/* { dg-final { scan-tree-dump-times {\.FMA } 3 "optimized"} } */ ..., I still see these latter two tree dump scans FAIL, for GCN: $ grep -C2 'was chosen for reassociation' pr110279-2.c.197t.reassoc2 2 *: a3_40 2 *: a2_39 Width =3D 4 was chosen for reassociation Transforming _15 =3D powmult_1 + powmult_3; into _63 =3D powmult_1 + a1_38; $ grep -F .FMA pr110279-2.c.265t.optimized _63 =3D .FMA (a2_39, a2_39, a1_38); _64 =3D .FMA (a3_40, a3_40, powmult_5); ..., nvptx: $ grep -C2 'was chosen for reassociation' pr110279-2.c.197t.reassoc2 2 *: a3_40 2 *: a2_39 Width =3D 4 was chosen for reassociation Transforming _15 =3D powmult_1 + powmult_3; into _63 =3D powmult_1 + a1_38; $ grep -F .FMA pr110279-2.c.265t.optimized _63 =3D .FMA (a2_39, a2_39, a1_38); _64 =3D .FMA (a3_40, a3_40, powmult_5); ..., but also x86_64-pc-linux-gnu: $ grep -C2 'was chosen for reassociation' pr110279-2.c.197t.reassoc2 2 *: a3_40 2 *: a2_39 Width =3D 2 was chosen for reassociation Transforming _15 =3D powmult_1 + powmult_3; into _63 =3D powmult_1 + powmult_3; $ grep -cF .FMA pr110279-2.c.265t.optimized 0 Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Fix-gcc.dg-pr110279-2.c-syntax-error-due-to-__attrib.patch" >From 91e9e8faea4086b3b8aef2355fc12c1559d425f6 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 15 Dec 2023 10:03:12 +0100 Subject: [PATCH] Fix 'gcc.dg/pr110279-2.c' syntax error due to '__attribute_noinline__' For example, for GCN or nvptx target configurations, using newlib: FAIL: gcc.dg/pr110279-2.c (test for excess errors) UNRESOLVED: gcc.dg/pr110279-2.c scan-tree-dump-not reassoc2 "was chosen for reassociation" UNRESOLVED: gcc.dg/pr110279-2.c scan-tree-dump-times optimized "\\.FMA " 3 [...]/source-gcc/gcc/testsuite/gcc.dg/pr110279-2.c:11:1: error: unknown type name '__attribute_noinline__' [...]/source-gcc/gcc/testsuite/gcc.dg/pr110279-2.c:12:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo' We cannot assume 'stdio.h' to define '__attribute_noinline__' -- but then, that also isn't necessary for this test case (there is nothing to inline into). gcc/testsuite/ * gcc.dg/pr110279-2.c: Don't '#include '. Remove '__attribute_noinline__'. --- gcc/testsuite/gcc.dg/pr110279-2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/pr110279-2.c b/gcc/testsuite/gcc.dg/pr110279-2.c index 0304a77aa66..b6b69969c6b 100644 --- a/gcc/testsuite/gcc.dg/pr110279-2.c +++ b/gcc/testsuite/gcc.dg/pr110279-2.c @@ -6,9 +6,7 @@ #define LOOP_COUNT 800000000 typedef double data_e; -#include - -__attribute_noinline__ data_e +data_e foo (data_e in) { data_e a1, a2, a3, a4; -- 2.34.1 --=-=-=--