From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-obe.outbound.protection.outlook.com (mail-cusazon11020017.outbound.protection.outlook.com [52.101.61.17]) by sourceware.org (Postfix) with ESMTPS id 24B063858C56 for ; Tue, 26 Jul 2022 20:12:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24B063858C56 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q9z+bv2A+CIRbCeVW+BjfC10/b62BIJxp/Ft9ZOWPL/ZC8JGx3Utg1f/QK6UeD7dqznO0e8F7t2/ZRsMu9lnj4PoaZ03JKuILDbRg9jvIrDnnuFtsAjuGd21WT6U9tBZOVxCf1POlSpi+0jAjHWMhBcBtLMpeQHKfpxnlP8MQib0Ha/K1ZbWqB5z0jON7zJBY9EMmQHY8+l1F3qU56lJbb3NfHcbeIwQlgiYkz2b+yNM33pUe2GbuEv2Yg7RoA7ZUocWzTizn0Vast6Dm1cYEe1NttTA3LbUC6I7n1jbjyO4J+R8XoswMdw//1M8mUobSRbWzXZxDPm2URX9c6ITRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m2kPL2Ui+Y93koHbEXmP0VCposDfnSOnB4NqEpU/eYY=; b=cdY8EMOnYhQMRyQKfDUSKS1v5XlvLdodYZd/GqkduqmuZyQsBIIEQ8xkzW2TxcNSgzLm0GzXVlyIM6pqX9bxOL8XyxBPoSe3Wb9Xrk/zDt2/CoNdusEI6fytQ7Fpw0wHs9t+wz2fMFo9dQ9/iV98PNFzMA85z0pWkHMSA4vGC/71cUA2/n8841uDVdZjl+0gVmsgcflmTbyLTr6mr3Q5tpanLAzswtnGf9mxc//RdOMa/0QNh8zd1C4gjgAYnehEED/5KaeWy0bayBgqXoZ8CNA6kZoA/mNQ42xNR0P26PqJYDhYBdO7+twlFUFrJ3vMjSMVa8iW1lX5BRnJ+Ch4KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from MW2PR2101MB1770.namprd21.prod.outlook.com (2603:10b6:302:8::14) by MN0PR21MB3243.namprd21.prod.outlook.com (2603:10b6:208:37f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.2; Tue, 26 Jul 2022 20:12:21 +0000 Received: from MW2PR2101MB1770.namprd21.prod.outlook.com ([fe80::ad41:9037:4510:b349]) by MW2PR2101MB1770.namprd21.prod.outlook.com ([fe80::ad41:9037:4510:b349%6]) with mapi id 15.20.5504.001; Tue, 26 Jul 2022 20:12:21 +0000 From: Eugene Rozenfeld To: Andi Kleen , Joseph Myers , Jan Hubicka , gcc Subject: Re: State of AutoFDO in GCC Thread-Topic: State of AutoFDO in GCC Thread-Index: AQHYoSwDrvTft2hTz0KNU80j7i7NwA== Date: Tue, 26 Jul 2022 20:12:21 +0000 Message-ID: References: <20210429054025.GB4032392@tassilo.jf.intel.com> <4d005159.55ea.1791e171ab9.Coremail.172060045@hdu.edu.cn> <875z0378j1.fsf@linux.intel.com> <67df7dbb.5eae.1794bba0ca3.Coremail.172060045@hdu.edu.cn> <7c802b11-857e-78eb-c2e8-0a3044817793@linux.intel.com> <20210509170121.GE25641@kam.mff.cuni.cz> <20210510172121.GT4032392@tassilo.jf.intel.com> In-Reply-To: <20210510172121.GT4032392@tassilo.jf.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=1f9e0857-70b7-4f29-9b21-2e656d5f59c0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-07-26T19:35:53Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8cb60655-81a7-469a-cb2f-08da6f4325b7 x-ms-traffictypediagnostic: MN0PR21MB3243:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nkOd6ikgIRVIKXJL9DKzEc8+6qJKjabrazlgkRURps5BU/y3ICsZG5oIPr4+eMZsqIrx3MMZuVxI6581KbL633d9A/WWtb2UVtnmNPWVIo2Tb3cvryRHo6A14+53edwY4xmg0nELfT/7IVdy5FVfM5OviExmOMz46yzEK/wPUNgjcqnFj55Ef98cfpKd6L0e6pzzkM9lLnydmnu1DKSURgixVp7v2vaLab64j26YkA+ZJpg+bz6H7JGJGJ/34oMm9OwnoUtwaepuS4FBou+QGBMFX5UZ7qx4Od2sUICfUZsHhw2zTEJ7VoQ9oFEZJ6QCpLaPPVgXpGcl5eAhhAHE239D37xD6sxLajyR+LRtErimVGVWbB62w3D96wPHJ2gHnsNCSDjWe/tUEmgYvUw4GiOugaidVFEfo2devFNWOHyEdQkgmoW9aRlOUWFXPoDdvUaxvPD1ev5F2N5frJbwIpdtw+WjUB1mB6cs4aUmeQWMLHl4SPRmqwUlRzLHX/jgW9iUdZSNbKRchI8rQQ0TiuVZ21MCwOKWdchwWAxc9V4Xwmrrctq6Fnv1mHpt8xx9Tx5Dr8QbZiotLEhNFzYmDjpyH8aQNYu1LNlOgTZAHtQmF5uIMuvR6c51b3S5/gyFPxPYO+2YiXpbDVsEoW119eySSX76hgZOAqe2UbRA5NdrEdYUBUlSOWrL9s+e2ufsz7EOaNFi9FaNWOoj3GpOG5gmnlTMKtsULNSztzvczZ3EorC1N35qv78HWW/Mh2HoZCiwZsUqj/Bv9Q/jkNLRFyFstLJnW4eBboD+Sl3ihH+ANICySnUDd9pGM4IMmFeDCAZk5oZNjMN40+fqrpWgx6SpzafI3JJANZoXSjvY7JA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR2101MB1770.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(366004)(396003)(39860400002)(136003)(376002)(451199009)(82950400001)(86362001)(122000001)(38070700005)(2906002)(8990500004)(33656002)(4001150100001)(53546011)(52536014)(30864003)(83380400001)(5660300002)(41300700001)(66476007)(76116006)(186003)(966005)(10290500003)(8676002)(316002)(64756008)(82960400001)(71200400001)(9686003)(66556008)(6506007)(55016003)(7696005)(110136005)(478600001)(66446008)(38100700002)(8936002)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KgLbZwFfVhHJgM4ZQ9sfA6yCyJYEPP5MaDB+iXmQAmmi57NN+wbaO5jf3jU7?= =?us-ascii?Q?2q0mR8fnorqdJKZ2ymRlvWEWviS+d0tPkkNp7sGXYDu1LlyVgp9CEGd200hP?= =?us-ascii?Q?5Idw9VqNvnspkwUWnVy2nAls97qh3zA5wjvvHKpLNeCCrrnyKIIwDMdJRFHM?= =?us-ascii?Q?Iw16j8MbM3C3iPLlAOHCi1iLpm26u1lhsx08JrMOpiUoGiZZIeY9dAy2B6gA?= =?us-ascii?Q?q7aPaBhJ67HUQqJJE914GghfiyEq7QS99T7OLL9hh0f9bepZbHF6OVXNJf22?= =?us-ascii?Q?YofbXtONW5/H4Lsku3yI2tdPsMw+6LVj28QdEol8KsY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WJE3JS7yvbO2l34DAc0jhD0neaiGpV4YzjEslCKJe1z8+Jc?= =?us-ascii?Q?tDrdbElp3cIdirTYliMwaNyEVxXzICy58Hy2MX3wqNCFbHs5ZPs3WuW98WaQ?= =?us-ascii?Q?aYLnMNVrCk53B6KsA4gIlXmJ0j0wWqIQD1eHYpTPe9HXxDj8MKD6L3OLc//Z?= =?us-ascii?Q?hbuwWpW0F14k2GTMwBANVMc9F3MvYIAIPkGG4cXw6uHfo/rhhFujm+822l/G?= =?us-ascii?Q?OAOWb4FJXaJpXKOkGld7Dw5H6x1OSTKVyzv70qyA/q6Z5Ydr5LRvi49RJNJ7?= =?us-ascii?Q?m0fg4x8RyNbsEDF1kK68pofsoMCbSIfQ+l2+OWFw4Ym+reK3GcX6PwC61mb6?= =?us-ascii?Q?ObEDFnJvtOWoSMAzv1w5w/UOI03Pq4CK2c4myOgATwXtA7K1q+pPewLji9u0?= =?us-ascii?Q?4OSijzuyAK6NYHUftTiq8ruWGuxkVuot+OxEsi7yfOkd?= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR2101MB1770.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb60655-81a7-469a-cb2f-08da6f4325b7 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jul 2022 20:12:21.2484 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sEdNyRLevjjkJ6ejWc07c3G5zM88oY4sxQwX1UhJqi9DVEWTljqV3xr0YgcyIRhlhP0zKg4P1rJ6vwabn01JsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR21MB3243 X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, HTML_MESSAGE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 20:12:27 -0000 Hello GCC community. I started this thread on the state of AutoFDO in GCC more than a year ago. = Here is the first message in the thread: https://gcc.gnu.org/pipermail/gcc/= 2021-April/235860.html Since then I committed a number of patches to revive AutoFDO in GCC: Fix a typo in an AutoFDO error string Update gen_autofdo_event.py and gcc-auto-profile. Fixes for AutoFDO tests Fix indir-call-prof-2.c with AutoFDO Fixes for AutoFDO testing Fix indirect call inlining with AutoFDO Improve AutoFDO count propagation algorithm AutoFDO: don't set param_early_inliner_max_iterations to 10. AutoFDO: Don't try to promote indirect calls that result in recursive direc= t calls Fix profile count maintenance in vectorizer peeling. I also made a number of fixes and improvements to create_gcov tool in https= ://github.com/google/autofdo . AutoFDO in GCC is in a much better shape now. I have a further set of patches that improve DWARF discriminator support in= GCC and enable AutoFDO to use discriminators. It's based on commits in an = old Google vendor branch as described in Andi's mail below but uses a different approach for keeping track of per-instruction discrimi= nators. I submitted the first (and the biggest) of these patches almost 2 months ag= o on June 2: https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dcommit;h=3D5af22024f6= 2f1f596a35d3c138d41d47d5697ca0 but only got a review from Andi (https://gcc.gnu.org/pipermail/gcc-patches/= 2022-June/596549.html) who is not allowed to approve patches for commit. I = pinged gcc-patches twice with no success. I would appreciate help in getting a review on this patch so that I can get= it committed and submit patches that depend on it. Thank you, Eugene -----Original Message----- From: Andi Kleen Sent: Monday, May 10, 2021 10:21 AM To: Joseph Myers Cc: Jan Hubicka ; gcc ; Eugene Rozenfeld <= Eugene.Rozenfeld@microsoft.com> Subject: [EXTERNAL] Re: State of AutoFDO in GCC On Mon, May 10, 2021 at 04:55:50PM +0000, Joseph Myers wrote: > On Mon, 10 May 2021, Andi Kleen via Gcc wrote: > > > It's difficult to find now because it was a branch in the old SVN > > that wasn't converted. Sadly the great git conversion was quite lossy. > > All branches and tags, including deleted ones, were converted (under > not-fetched-by-default refs in some cases); the git repository has > everything that might plausibly be useful, omitting only a few things > that would have been meaningless to convert, such as mistaken branch > creations in the root of the repository and the SVN hooks directory. > Use "git ls-remote git://gcc.gnu.org/git/gcc.git" to see the full list > of over 5000 refs available in the repository (or do a clone with > --mirror to fetch them all). Okay thanks. I don't see them in any of the web interfaces, neither on https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgcc.gnu= .org%2Fgit%2Fgitweb.cgi%3Fp%3Dgcc.git&data=3D04%7C01%7CEugene.Rozenfeld= %40microsoft.com%7C9d79b87018f24bcbf8cc08d913d80bd0%7C72f988bf86f141af91ab2= d7cd011db47%7C1%7C0%7C637562640903545786%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC= 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata= =3Dts53XULDtR3o7fevlntCJdtzRqTo9R85LrxJ0ZfOBnE%3D&reserved=3D0 nor on https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.= com%2Fgcc-mirror%2Fgcc&data=3D04%7C01%7CEugene.Rozenfeld%40microsoft.co= m%7C9d79b87018f24bcbf8cc08d913d80bd0%7C72f988bf86f141af91ab2d7cd011db47%7C1= %7C0%7C637562640903545786%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQI= joiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3D%2FPGF3vy3hD1O= wiXmWzkUnOt9%2BR3YArZw0kCVueOKYpc%3D&reserved=3D0 but git fetch origin vendors/google/heads/gcc-4_8 does the trick for fetching t= he commits, but not the symbolic branches. Anyways with that it looks like the discriminator changes are: commit fd9de90d750e3588b1e5a218b28102b6c8bb8434 Author: Dehao Chen > Date: Thu Oct 10 14:39:31 2013 +0000 Use only lineno+discriminator (remove the callee function name) as the = key to represent callsite. Because each callsite will have its discriminato= r if in the same line. 2013-10-10 Dehao Chen > * gcc/auto-profile.c (get_function_instance_by_decl): Remove callee_name from callsite. (read_function_instance): Likewise. From-SVN: r203379 commit 3987da76affbfbe7195c0a16b33beedc649ec14f Author: Dehao Chen > Date: Tue Aug 27 16:46:49 2013 +0000 Refactor AutoFDO to: 1. Now that we have discriminator for inlined callsite, we do not need = special handling for callsite location any more. 2. If a source line is mapped to multiple BBs, only the first BB will b= e annotated. 3. Before actual annotation, mark everythin BB/edge as not annotated. 2013-08-27 Dehao Chen > * gcc/auto-profile.c (location_set): New data structure. (get_count_info): Add new parameter. (get_combined_location): Remove unused parameter. (get_inline_stack): Remove unused parameter. (afdo_get_bb_count): Add new parameter. (afdo_annotate_cfg): Reset annotated flags. commit 1e6c4a7a8fb8e20545bb9f9032d3854f3f794c18 Author: Dehao Chen > Date: Thu Aug 22 17:20:29 2013 +0000 Set discriminator for call stmts within a same basic block. 2013-08-22 Dehao Chen > * gcc/tree-cfg.c (assign_discriminators): assign discriminator = for call stmt in a same BB if it is mapped to a same line. commit b0be0175f4cf18fdd77bb013b181eead3a0a4773 Author: Dehao Chen > Date: Mon Aug 19 21:26:33 2013 +0000 Fix the discriminator assignment bug during hashing. 2013-08-19 Dehao Chen > * tree-cfg.c (next_discriminator_for_locus): Fix discriminator assignment bug. From-SVN: r201857 commit 9fa26998a63d4b22b637ed8702520819e408a694 Author: Dehao Chen > Date: Mon Aug 19 20:16:47 2013 +0000 Add discrminator for inlined callsites. 2013-08-19 Dehao Chen (dehao@google.com) * include/dwarf2.def (DW_AT_GNU_discriminator): New attribute. * gcc/dwarf2out.c (add_call_src_coords_attributes): Emit discri= minator attribute for inlined callsite. From-SVN: r201856 -Andi