Message ID | MW2PR2101MB1100FD232D47234C3965452291229@MW2PR2101MB1100.namprd21.prod.outlook.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21C08385AC24 for <patchwork@sourceware.org>; Fri, 28 Jan 2022 23:24:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21C08385AC24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643412261; bh=fUoWnt2fDpqDfadXOiBBuDrXQvlx4fj1oHwa1ONqw4k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SvG74RheE1FJf9EfjiPOUxb+m7Cm7SKgOgzebqt8l3QXptJDrHJ09HXLMIbb8iJ6W BalGc4BGzfhXSKmY8rItvIYfy6+Hhkhtw0+fgwr7JDPSJrIEDJV0qW50nuC1DHHNyK m8BsOI/4GqYfxhJmhFr5W/O7AEJTET8Nsx0bXwCg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from na01-obe.outbound.protection.outlook.com (mail-eus2azon11020025.outbound.protection.outlook.com [52.101.56.25]) by sourceware.org (Postfix) with ESMTPS id 3E3433858D28 for <gcc-patches@gcc.gnu.org>; Fri, 28 Jan 2022 23:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E3433858D28 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KhFK3s3jqlaGoA+0OjyNxYGLHC68l9pfcJmd/OwjHNGUdvD1NTElvpL5K8SXgWaYBNsatskM+PPOTmS5IV18gTBmp7wq8qq87ZlPsp0rfOJyK+sQVyuciOFTYodzc4pKHGk3dzj6OX4Bxs1B/G6Dp+0y7TjvinAnyHnN5Nhlf8ssVv4LoZuFy+iaUYgUGo5b2HkE/hecHFnufqg7w9v5mbwFYOghKj6qc+PzwBgB2Qz7PSUtelwdGpgNh/Y9wGalgGA/jPUhyusKBdEILuBK8mAUaWUyxl2tqDFsMoxrfaHjiL/fd8mD636u7dgniubTq+LkhN9s1Tzrmt6PZ4PEMw== 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=fUoWnt2fDpqDfadXOiBBuDrXQvlx4fj1oHwa1ONqw4k=; b=PwBDTH4VAavcnyYN2i/R9zRkBVwvB63YFDyf3/xS/zrdYMn5T+pfY4LQkOXZ07J5npgTtrvkHWv07flJ10XoZf83LiGuFHqUN75ALx9giRybqgqOd2sa3aeWhYQHYJ68oh91B/qSiITR4Uz16G50Fu4xjR5WknCFG3ZWX2Fii+FqxfqtEEe7+h7f6RGpXllLUlSgPGGx+w9eB6LaoEd5+vEdn13zZf82uPgDDpih7oWpD9HrEHlAaV4vjmcC2mDvDV3fBuEZE6iuMu5ciTCKNeJKluhgwdZ8GC7SxQCObI3kh4I1tMs6p346IB9HEJPLEgUwTKWlEZwYPgbHjiytOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MW2PR2101MB1100.namprd21.prod.outlook.com (2603:10b6:302:a::29) by BYAPR21MB1735.namprd21.prod.outlook.com (2603:10b6:a02:c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.9; Fri, 28 Jan 2022 23:23:43 +0000 Received: from MW2PR2101MB1100.namprd21.prod.outlook.com ([fe80::f02e:954b:3945:7d74]) by MW2PR2101MB1100.namprd21.prod.outlook.com ([fe80::f02e:954b:3945:7d74%3]) with mapi id 15.20.4951.005; Fri, 28 Jan 2022 23:23:43 +0000 To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> Subject: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10. Thread-Topic: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10. Thread-Index: AdgUnfJ2LMPZuZklRWWHTfYlnRm4sA== Date: Fri, 28 Jan 2022 23:23:43 +0000 Message-ID: <MW2PR2101MB1100FD232D47234C3965452291229@MW2PR2101MB1100.namprd21.prod.outlook.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=dc5a09a2-0b9a-4661-bd01-c940fe1d8d5c; 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-01-28T23:10:12Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3453702f-36f2-4096-aeed-08d9e2b539a4 x-ms-traffictypediagnostic: BYAPR21MB1735:EE_ x-ms-exchange-atpmessageproperties: SA|SL x-microsoft-antispam-prvs: <BYAPR21MB1735E8B64C9BD5E73621834391229@BYAPR21MB1735.namprd21.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VPVxHHkqGjjZ8Tou2ZNOW0fGXsRPnOkl1B6187GCoI/yw1/bVDpt5tQWC9+a4i9hOYFB8G7tXQSDjMfDWvO6EvbjMvOxbwEN0WbLlfH/1ojbZjt/sspWJSlKuX1INw4QI/LQ7adkyp6YXUn9JTzsxcCqytDHFdnSJanTeOtsp15i6ygSQohbvQQ5ySGMd77f1ys2RE+Mt8OBj4kwtN2C6FaCz1rb3+cjrz/yBUMkVQ9DpdNozmVOdl4sZuzD0rludcjXcEIxnts+hcovOZJOpKJ14S9UfEffZ+xHaQvMGWsfjU3uGIUMfUScY4rG2Dv/ol7MZWR8xc+6Tsa57/7JGr2YeafIR9vwhwOZp9pHpf5Gq28+7gAJNFJsgsAHc8ggEaMuyuwCTy+CSXhSCfbr6y5jcsj1jKxbjREErRS6HZ8AJJgt9meOkfRXWyKQ9YJ8HV5I0RT6NyAgDs8moC8/Lofw0Kd3Wt8qve4l9Iwr/cJ28N4NuERgvFqu0x0LhnWohMNA6Ihd53r81zYPr/cQd6oNO6smU9thPdKuplkXSiKCL9SfTDFMV4jcChsTvTiVFGE/EOSiS9A2XPIz2WYcqtx5LEyt9gdYQUhjr7yWQ69D/67mB6o2jS3bvEiv/yNC+HB2TlErx82Y5+W0/zaiTMFLYsmY3RuXR1KMkrFomjAAIaY5wqxaBv8/x4nEY5/woU6jKX3MgpLzmMUI7YU2jgvu7RZeUh+8NQ0/pUemTRusOdX2M12+bXBicXtbDiKh x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR2101MB1100.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8990500004)(2906002)(64756008)(10290500003)(186003)(66446008)(66946007)(52536014)(55016003)(66556008)(38100700002)(83380400001)(66476007)(5660300002)(508600001)(86362001)(9686003)(122000001)(82950400001)(8936002)(6506007)(38070700005)(6916009)(8676002)(7696005)(82960400001)(33656002)(316002)(71200400001)(76116006)(20210929001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 7WT0icbD2Tf202J7wkLKkrw3s0tOTQjl3UqYwtFmqgKq2gSebXKLC3Fkc0ZPFEbRbS5mPNnnY2kBM4QBQDTJV3Zy14uS6ZtmOPqWOTgTy3J5DhF00uYFvXJpZO/MC0pM2BaeeIBqxcNKE4wqnNwuTmLOV2gNr3UOVvJz6dpXi8vInZUeqTbMLUoFMJC8f0AsAVKZL0ggYVVV0DaGhjO4sU9Orp+84WoE51EUPs32vLIjdZGPUTgHEwN3V6mgwrxEHimh7OR9bwJF88iCbMW51QROA3UkjbXTEwoBRwOsKG8vFgW8QgripXy3csQA7Jaddl41Y4cJpLowRX575kyIDVeDv0VDiE0MtCk1vhKzHNm5m4A+hURErxzBD+c2HNx2AOTYwuhs3QwOY7t64Q/jPrXS/tHQxVlXmqzEf/H53pYBstk1U5VbNyJuTcsHiAfYJ+jUnLD0Z1hLHxYZp+5wOc2F45iTnWn4p53FHOPKQWky+TDPDZBs7f4EVOzCB/iKkSUabkAK14lz1H3uwWP4D0FxdktMr4GG+7gNlWC6VJIh6Jp/NtkVlZ/C8S+AvJnZVof7rxtM1mLr5j/dfyIZXe6yAOHaj1O88ia7niV1lfbWSZF8cTtW55uBl5MGNuh4aGG0fMklmZHRDzDti/APfdg9l4ocPCFVkIWQWF3lWiIH9sLhnXsE76KgsRiLp1UG9uJVxv/GtgMvKK3fTXeg/F3Jz0a9hFZBNu7/6oAfY4GSu1YgqRZt2f+nhxJ7IMxeMV1dFj22EID60dzBquMYnwZfM80g5+B8zxQQzBGGng2weC7KnSVunliELpSWsn+qfYQ1K/qlNoeF4fsOyL7TKicnsfYHuulbrZbjL6RfHxOGX4RwxyA+TrWo8+HpA1cGC/+x/ya3D1QaQF6uotiJSSBl4E5deJNPlyKZoajSuHudI+aWbHTtVjd4ECZBaQYUoIXz9j4KHA+Y5rLS2Eda19NEVZzRYnhGqKio+jaFiTV8Fj7em3HYV0+uhTFPHL9kch1sCTzMY6Gs4XP8BzYv2UllCJG2chtcsnwoK4TMP3ksQ7FcBL2yiQqPSnjZyYAZVPLc7O9KarsU0MJhBxC+RENRHkpNMKrPvYDSUuFjK25bCpNFmwpEzfEzrCTLgGAooYSB/vQ5E+9VERWxU0PfIkIL8BYCO4wy/y1GB5aH3DGdTl4rZeyqiYLjqrh8fyVAj65r6zgD9F6lew6h1xURAmVMvfBwLFGaGtNMsZwm5GvMbYSj5IdEvQ9l7OM369Ea+17QWWZD7eB4Im/sgA5sYUli1X22qE262zI0mAa3YtvvJBot76UQkoQLR/k6nNmT4x1uMe/3k8D+rbshn3++MYoaFwlbuGpJm4gCWlwSCvty0m9w7Gq3PHAaKfbJ4Hj5jkumDSOpw3bm5c3FjU3eVB6V0iBw6+W9Hmyyy2JQin7pugz6sIUlyg4wl1OqYN4lxZywVDeCzy7HCJwUTTKba2AsgMfFAuC0UKOkV/iYmfbw+49XovfbGiqYDerJPLnN5ltOBlwO3vQ66LgseCEOFDdABA6yGzf9dvh9Tl1tkFgt66ARb5gd7q07tux6CursX7mSyC5osqgh93FucxVd/trWwkIcLhiyodDoJ5H8eXrGP77O0wh2DPyVOF76HTXzYuD69/8+HLyGKRV6TOtqJw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR2101MB1100.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3453702f-36f2-4096-aeed-08d9e2b539a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2022 23:23:43.2237 (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: 4AUTxnFaXVbPO6IF0/o1G/ygR7I/8y12jWBZ96dq7nTyq0Mr3yloCstTh1CULp4IwWjha+y+z3cqKm4EAmpfUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR21MB1735 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
AutoFDO: don't set param_early_inliner_max_iterations to 10.
|
|
Commit Message
Eugene Rozenfeld
Jan. 28, 2022, 11:23 p.m. UTC
param_early_inliner_max_iterations specifies the maximum number of nested indirect inlining iterations performed by early inliner. Normally, the default value is 1. For AutoFDO this parameter was also used as the number of iteration for its indirect call promotion loop and the default value was set to 10. While it makes sense to have 10 in the indirect call promotion loop (we want to make the IR match the profiled binary before actual annotation) there is no reason to have a special default value for the regular early inliner. This change removes the special AutoFDO default value setting for param_early_inliner_max_iterations while keeping 10 as the number of iterations for the AutoFDO indirect call promotion loop. This change improves a simple fibonacci benchmark in AutoFDO mode by 15% on x86_64-pc-linux-gnu. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * auto-profile.cc (auto_profile): Hard-code the number of iterations (10). gcc/ChangeLog: * opt.cc (common_handle_option): Don't set param_early_inliner_max_iterations to 10 for AutoFDO. --- gcc/auto-profile.cc | 3 +-- gcc/opts.cc | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) -- 2.25.1
Comments
On Sat, Jan 29, 2022 at 12:24 AM Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > param_early_inliner_max_iterations specifies the maximum number > of nested indirect inlining iterations performed by early inliner. > Normally, the default value is 1. > > For AutoFDO this parameter was also used as the number of iteration for > its indirect call promotion loop and the default value was set to 10. > While it makes sense to have 10 in the indirect call promotion loop > (we want to make the IR match the profiled binary before actual annotation) > there is no reason to have a special default value for the > regular early inliner. > > This change removes the special AutoFDO default value setting for > param_early_inliner_max_iterations while keeping 10 as the number of > iterations for the AutoFDO indirect call promotion loop. > > This change improves a simple fibonacci benchmark in AutoFDO mode > by 15% on x86_64-pc-linux-gnu. > > Tested on x86_64-pc-linux-gnu. OK. Richard. > gcc/ChangeLog: > * auto-profile.cc (auto_profile): Hard-code the number of iterations (10). > > gcc/ChangeLog: > * opt.cc (common_handle_option): Don't set param_early_inliner_max_iterations to 10 for AutoFDO. > --- > gcc/auto-profile.cc | 3 +-- > gcc/opts.cc | 2 -- > 2 files changed, 1 insertion(+), 4 deletions(-) > > diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc > index 0bfaae7b091..c7cee639c85 100644 > --- a/gcc/auto-profile.cc > +++ b/gcc/auto-profile.cc > @@ -1644,8 +1644,7 @@ auto_profile (void) > function before annotation, so the profile inside bar@loc_foo2 > will be useful. */ > autofdo::stmt_set promoted_stmts; > - for (int i = 0; i < opt_for_fn (node->decl, > - param_early_inliner_max_iterations); i++) > + for (int i = 0; i < 10; i++) > { > if (!flag_value_profile_transformations > || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) > diff --git a/gcc/opts.cc b/gcc/opts.cc > index 17e1884f0e4..f6f6a8e1709 100644 > --- a/gcc/opts.cc > +++ b/gcc/opts.cc > @@ -2899,8 +2899,6 @@ common_handle_option (struct gcc_options *opts, > case OPT_fauto_profile: > enable_fdo_optimizations (opts, opts_set, value); > SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_correction, value); > - SET_OPTION_IF_UNSET (opts, opts_set, > - param_early_inliner_max_iterations, 10); > break; > > case OPT_fprofile_generate_: > -- > 2.25.1
Thank you for the review Richard. Is it ok to commit this change to trunk now or should I wait till GCC 13 development starts? This seems like a very low risk change. Thanks, Eugene -----Original Message----- From: Richard Biener <richard.guenther@gmail.com> Sent: Monday, January 31, 2022 1:23 AM To: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com> Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10. On Sat, Jan 29, 2022 at 12:24 AM Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > param_early_inliner_max_iterations specifies the maximum number of > nested indirect inlining iterations performed by early inliner. > Normally, the default value is 1. > > For AutoFDO this parameter was also used as the number of iteration > for its indirect call promotion loop and the default value was set to 10. > While it makes sense to have 10 in the indirect call promotion loop > (we want to make the IR match the profiled binary before actual > annotation) there is no reason to have a special default value for the > regular early inliner. > > This change removes the special AutoFDO default value setting for > param_early_inliner_max_iterations while keeping 10 as the number of > iterations for the AutoFDO indirect call promotion loop. > > This change improves a simple fibonacci benchmark in AutoFDO mode by > 15% on x86_64-pc-linux-gnu. > > Tested on x86_64-pc-linux-gnu. OK. Richard. > gcc/ChangeLog: > * auto-profile.cc (auto_profile): Hard-code the number of iterations (10). > > gcc/ChangeLog: > * opt.cc (common_handle_option): Don't set param_early_inliner_max_iterations to 10 for AutoFDO. > --- > gcc/auto-profile.cc | 3 +-- > gcc/opts.cc | 2 -- > 2 files changed, 1 insertion(+), 4 deletions(-) > > diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index > 0bfaae7b091..c7cee639c85 100644 > --- a/gcc/auto-profile.cc > +++ b/gcc/auto-profile.cc > @@ -1644,8 +1644,7 @@ auto_profile (void) > function before annotation, so the profile inside bar@loc_foo2 > will be useful. */ > autofdo::stmt_set promoted_stmts; > - for (int i = 0; i < opt_for_fn (node->decl, > - param_early_inliner_max_iterations); i++) > + for (int i = 0; i < 10; i++) > { > if (!flag_value_profile_transformations > || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) > diff --git a/gcc/opts.cc b/gcc/opts.cc index 17e1884f0e4..f6f6a8e1709 > 100644 > --- a/gcc/opts.cc > +++ b/gcc/opts.cc > @@ -2899,8 +2899,6 @@ common_handle_option (struct gcc_options *opts, > case OPT_fauto_profile: > enable_fdo_optimizations (opts, opts_set, value); > SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_correction, value); > - SET_OPTION_IF_UNSET (opts, opts_set, > - param_early_inliner_max_iterations, 10); > break; > > case OPT_fprofile_generate_: > -- > 2.25.1
> Am 31.01.2022 um 22:05 schrieb Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com>: > > Thank you for the review Richard. Is it ok to commit this change to trunk now or should I wait till GCC 13 development starts? > This seems like a very low risk change. Yes, it’s Ok now. Richard > Thanks, > > Eugene > > -----Original Message----- > From: Richard Biener <richard.guenther@gmail.com> > Sent: Monday, January 31, 2022 1:23 AM > To: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com> > Cc: gcc-patches@gcc.gnu.org > Subject: [EXTERNAL] Re: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10. > >> On Sat, Jan 29, 2022 at 12:24 AM Eugene Rozenfeld via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: >> >> param_early_inliner_max_iterations specifies the maximum number of >> nested indirect inlining iterations performed by early inliner. >> Normally, the default value is 1. >> >> For AutoFDO this parameter was also used as the number of iteration >> for its indirect call promotion loop and the default value was set to 10. >> While it makes sense to have 10 in the indirect call promotion loop >> (we want to make the IR match the profiled binary before actual >> annotation) there is no reason to have a special default value for the >> regular early inliner. >> >> This change removes the special AutoFDO default value setting for >> param_early_inliner_max_iterations while keeping 10 as the number of >> iterations for the AutoFDO indirect call promotion loop. >> >> This change improves a simple fibonacci benchmark in AutoFDO mode by >> 15% on x86_64-pc-linux-gnu. >> >> Tested on x86_64-pc-linux-gnu. > > OK. > > Richard. > >> gcc/ChangeLog: >> * auto-profile.cc (auto_profile): Hard-code the number of iterations (10). >> >> gcc/ChangeLog: >> * opt.cc (common_handle_option): Don't set param_early_inliner_max_iterations to 10 for AutoFDO. >> --- >> gcc/auto-profile.cc | 3 +-- >> gcc/opts.cc | 2 -- >> 2 files changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index >> 0bfaae7b091..c7cee639c85 100644 >> --- a/gcc/auto-profile.cc >> +++ b/gcc/auto-profile.cc >> @@ -1644,8 +1644,7 @@ auto_profile (void) >> function before annotation, so the profile inside bar@loc_foo2 >> will be useful. */ >> autofdo::stmt_set promoted_stmts; >> - for (int i = 0; i < opt_for_fn (node->decl, >> - param_early_inliner_max_iterations); i++) >> + for (int i = 0; i < 10; i++) >> { >> if (!flag_value_profile_transformations >> || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) >> diff --git a/gcc/opts.cc b/gcc/opts.cc index 17e1884f0e4..f6f6a8e1709 >> 100644 >> --- a/gcc/opts.cc >> +++ b/gcc/opts.cc >> @@ -2899,8 +2899,6 @@ common_handle_option (struct gcc_options *opts, >> case OPT_fauto_profile: >> enable_fdo_optimizations (opts, opts_set, value); >> SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_correction, value); >> - SET_OPTION_IF_UNSET (opts, opts_set, >> - param_early_inliner_max_iterations, 10); >> break; >> >> case OPT_fprofile_generate_: >> -- >> 2.25.1
diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 0bfaae7b091..c7cee639c85 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -1644,8 +1644,7 @@ auto_profile (void) function before annotation, so the profile inside bar@loc_foo2 will be useful. */ autofdo::stmt_set promoted_stmts; - for (int i = 0; i < opt_for_fn (node->decl, - param_early_inliner_max_iterations); i++) + for (int i = 0; i < 10; i++) { if (!flag_value_profile_transformations || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) diff --git a/gcc/opts.cc b/gcc/opts.cc index 17e1884f0e4..f6f6a8e1709 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -2899,8 +2899,6 @@ common_handle_option (struct gcc_options *opts, case OPT_fauto_profile: enable_fdo_optimizations (opts, opts_set, value); SET_OPTION_IF_UNSET (opts, opts_set, flag_profile_correction, value); - SET_OPTION_IF_UNSET (opts, opts_set, - param_early_inliner_max_iterations, 10); break; case OPT_fprofile_generate_: