From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-obe.outbound.protection.outlook.com (mail-cusazon11020025.outbound.protection.outlook.com [52.101.61.25]) by sourceware.org (Postfix) with ESMTPS id BDEB83858CDA for ; Wed, 20 Jul 2022 19:35:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BDEB83858CDA ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jp0XrSGBNyzB/eHMmWpKonv5CsD+QN4wm0OfWOjwXfcXGhPWMgEd8+IWxO54AJELAnnpox98wUeDwBexNpvLt1qbNVGqY5VRToy6WVUtB+ZQFYgBjGW0fT1XO1rTtSmuV1dMynzcbxa7fZNP4a2s4M+VIKBkjoX2xmHrcPT00a+1jciVBaXaR2vaY3/hahDimCCMJqNff9kkKQs6hpsGN1hCyBM89i54lhHata8n7slC3lDBRzZdBgTlMEJjilCk+LNfxYeZsK2tWqDLS6AUtpmZDCYOF0az0f76Lfu6Nt/7XUCSAA6SodEw6LqEmEge7uMbHPkS9EXI4kJigOQt2A== 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=/hvGH4nkTW9P7gDFFxJIv1g2/lCeMZufUpmytd2u2NA=; b=irdhei/THqtomj4OwU/hJNJ6OLVyjk4aLIwuE2rWZ1/XjsAO4NxJ/AqhkhZN6ZTUa4zQeY/XhasmiSXnW3NKuxlxPB77JIqmWQiikzVRte6hxFBg4hSYmtgrTmUIXUQnvtrkQ5p1VvGmLAWlnU8kpruBGDSJr2C/yJmVDCmA0ueVxAk3v4EHHisUIDDoYnKus/Y7AsbQL9Q+Q7ROBi1Hp3/hzAAMjuwdd0rbDftxAkpg4LGmEo5SFtfISWzVK70D9TkUq+2iKbGg0vq5eoeHqj7w+rY+c5+j4pTGqoqeFxVb/TGzYq/+RDRFFIhNsvCVGEzF6si2q6GcjqQPPLowcQ== 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 CY4PR21MB1540.namprd21.prod.outlook.com (2603:10b6:910:8a::20) by DS7PR21MB3295.namprd21.prod.outlook.com (2603:10b6:8:7f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.1; Wed, 20 Jul 2022 19:35:29 +0000 Received: from CY4PR21MB1540.namprd21.prod.outlook.com ([fe80::a4c4:55e9:fd5a:df82]) by CY4PR21MB1540.namprd21.prod.outlook.com ([fe80::a4c4:55e9:fd5a:df82%5]) with mapi id 15.20.5482.001; Wed, 20 Jul 2022 19:35:29 +0000 From: Navid Rahimi To: Edgar Mobile , "gcc-help@gcc.gnu.org" Subject: Re: Try to understand output of -fdump-ipa-inline Thread-Topic: Try to understand output of -fdump-ipa-inline Thread-Index: AQHYm3Z5ldXLF5KQhkmTIvEfKu/LZK2GA4y9gADkxk2AAL13wg== Date: Wed, 20 Jul 2022 19:35:29 +0000 Message-ID: References: In-Reply-To: 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_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-07-20T19:35:29.120Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ee8649c5-03a2-4615-e61e-08da6a87010e x-ms-traffictypediagnostic: DS7PR21MB3295:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gf8gttqa6BscdsvoGS1hqcjcyH+VKtLRcAKfAWHBLMpIu8zp7USljUt1xjx7bBsReFBKpqLGwvUeMkCa9bHqTW8VsJ+If4Schi8OlwMyaJgqaDklqUjWk3oNMhI4xI1EV4i7DrnMuaS2tEezOg4z3a7VREuMnksXhrBiR0QCrNadfhihezSw4uHv2xNnrbbIqldN8W7nBZhbrv8awYjtq0ZB6rJT7zo1iWKFDx2OELSBtnrMFbYfj1U8o99PgElFq9I3vZXijKlDgZp0W4Rwwxptq8YSW7a3H0MHje/dagGGGe/RvGIh1mLZdpw0bwWMbs9fsXIT+KTSCBRib57YBPHiT3P39EuWu1UgrJxXmXgNuAUE6Pnvm7vI+bvU0//vplyAYiUfy5Ixc7keWX45j5i1k8StCuIZARIcKohpNWtotdHIDGXP5PBKWKmBeWNOET2DdwMIPuyYSmmX/B9UNTMsVsYlZxfHPEZqaX3fF2DXJpNiZ4k+TXvToOw9DG7hdfAwtk5I39bppQefokoKQKQrHfJvxQL02fvsalKOn/tzCd4eL3jtxwJVeJhcwQe82oQ6rmJpt+cCdMFVVZ4TNKVojpE2C2IRHFt27C/IufkeI/UkM27mSHt2CZ052q9V8lVOfOtXGxTn9zLuUE/HFHYodP6keMdW7RI+drf6+FWDLRubkjSfAR/o/voxb3cvqpDpM/m8RzMB8pGhNrhbmoQbU2+HL8gRKUFsATu5mgqdPN8TORni0tHZTQSsDXIbG/DU5abM7y6jsikvoJxhvZ1oWLxPSpCxeaX9nBt67QQqUE0J7alWqEJozaR9Vyp2v1SuKwRswjhksDlP2g0R3ggOlkb6CuXrNlJ56ltxfkkyiRW6/m7OB2UJk16v57D+ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR21MB1540.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(39860400002)(366004)(136003)(376002)(396003)(451199009)(52536014)(64756008)(33656002)(5660300002)(8676002)(38100700002)(66446008)(8936002)(66556008)(66946007)(10290500003)(110136005)(38070700005)(66476007)(53546011)(91956017)(82960400001)(7696005)(76116006)(6506007)(8990500004)(316002)(82950400001)(83380400001)(9686003)(55016003)(122000001)(86362001)(186003)(71200400001)(478600001)(2906002)(41300700001)(966005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3aFb6jSSVvaLVsb+CYwTacFWxUAHIon71GNrdQp/KcAWXd3vMi2bYcgg0RSD?= =?us-ascii?Q?uE33KZcshOpPfCxT45XJZOSvGssrf6We0K/8dT6utQ8q7vUYV85d0/PVbE5i?= =?us-ascii?Q?Mc1uVk1g1vZLSVrz+47aNFsDhJUKwY/a2IM6XyuN/QbdfdqGv8Sd6Y7JqPeY?= =?us-ascii?Q?uvXMZo9VBBXVB8eqYzmrazyCx2mG5BkkobXWSI/2W8gPkQrK1Djwx2H4FWrI?= =?us-ascii?Q?E5M3DUWZhcmLE+w3NAgbpRRE0HxYtb1Xzk/zXgPHQCt6VVqPJt9kGdXJ6u+7?= =?us-ascii?Q?OibczaPiGd8I/OHZjq9tfEpJnFkuds5JOj27UhMC2ESoEqmQIVFIpdqewHy1?= =?us-ascii?Q?ORJIZahkDr2bxcu0zfU4w7kgBZwe4YHA7M6qlxwFKenVs6BJWnxBF0wLPZ9q?= =?us-ascii?Q?6cTXwcMZ7hbuj2crxRchYWmRgceRvVc/6Jl0PvJFIfuDC9Vx6vKXg/jMMoAv?= =?us-ascii?Q?hwkyGG019OlumyMsAC8ImE9diwJRM3F5wS5EIGFmi4zDTrGsiaCv0uTrfe7+?= =?us-ascii?Q?f0+jMHtPYDpa0dFvmz9SKnLFYEJ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1iBw1NXqUfrJ1LW2UPxU4JwiT7Xhgxj/5LkJy03Bt8a/pcJ1gP9R77kz?= =?us-ascii?Q?hvJ9jeTjx2XvyyTxtjDR3QKj5+8NzEnxYds0OOatTir7pU1HOR/VOPvZcsSB?= =?us-ascii?Q?VD5KSYWrm+Z/kfbTNxZf8vyW6Oi+doM1tbEQ+MRH?= 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: CY4PR21MB1540.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee8649c5-03a2-4615-e61e-08da6a87010e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2022 19:35:29.6760 (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: x1d6jeVBQUrQklTv1jQVeSUpWe8TO9Lr6X+V9ctNDG64hfF896SgpDjLH8yrMF+NXUymKjZwwyLs+bkiM69DZTt7UxN4cmooS+mqWJY7TbE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR21MB3295 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, KAM_ASCII_DIVIDERS, 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 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2022 19:35:34 -0000 > I tried to create a *.so example from it for which I literally copied the= calling and called function. It is inlined correctly. No, this would not work. What I meant is to try to comment out extra code a= s much as possible. Somewhere you are going to see a difference between (a)= having a code and (b) elimination of the code. That would give a better in= sight into what is going on. Although admittedly this might not work either= , or in some cases the code is too complex to do something like this. But T= hat's what I would do at least. Regarding the plt, I am not expert in this area. So take this with grain of= salt. But my understanding is the PLT decision is happening inside the lin= ker (or at least lower level IR inside GCC). So I would investigate why the= inliner in GIMPLE IR layer does not inline the function. That would be muc= h more relevant I suspect. As I said, try the always_inline attribute and look at the result. Inliner = does calculate a complex logic to decide whether it should inline a functio= n or not. Your code is closed source, and it is not possible for me to eval= uate it. It might be the case that the function is so big that the inliner = decides that it worth not inlining at all. Best wishes, Navid. ________________________________________ From: Edgar Mobile Sent: Wednesday, July 20, 2022 01:10 To: Navid Rahimi; gcc-help@gcc.gnu.org Subject: [EXTERNAL] Re: Try to understand output of -fdump-ipa-inline I tried to create a *.so example from it for which I literally copied the c= alling and called function. It is inlined correctly. In the original project, g++ seems to be determined to create a plt entry f= or the to-be-inlined function although I gave it the visibility=3Dhidden at= tribute (also -fvisibility=3Dhidden in the g++ parameters). Will a plt entry prevent a function from being inlined? Is there a way to find out why g++ creates a plt entry although I'm trying = to prevent this? Regards ________________________________ From: Navid Rahimi Sent: Tuesday, July 19, 2022 6:27 PM To: gcc-help@gcc.gnu.org ; Edgar Mobile Subject: Re: Try to understand output of -fdump-ipa-inline Have you tried to make a similar example? What I do in this situation is tr= y to replicate exact situation but in a smaller case. Inlining decision happens in multiple levels. It is hard to find out what i= s the exact reason this way. Just as experiment, try it with always_inline [1] too. 1. https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html Best wishes, Navid. ________________________________________ From: Gcc-help o= n behalf of Edgar Mobile via Gcc-help Sent: Tuesday, July 19, 2022 06:56 To: gcc-help@gcc.gnu.org Subject: [EXTERNAL] Try to understand output of -fdump-ipa-inline Greetings, I try to find out why a function (inline keyword, defined in header) is not= inlined. Example for -fdump-ipa-inline output: Considering void Vertex::update(const Data&)/5927 with 40 size to be inlined into void SomeClass::updatePoly(const Data&, Polyline&)/1118= 1 in /somepath/SomeClass.cpp:663 Estimated badness is -0.000083, frequency 4.69. The function is never inlined. unfortunately, the code is proprietary, so I= cannot post everything. Can anyone explain me the message above to find out why? Thanks