From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30F873858410; Tue, 21 Feb 2023 12:39:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30F873858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676983148; bh=S3TmeiYe+mNYM+5SRef6VZIImDf8R0GhFrZoS11zCqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wlt2RaHHvk62mOmCV5eyDqnYQxS8Dt87O03rZZ0swowBYqwSSnaWKgPibJPDE5CBj I2CEGPt6pbkya61nWaVyl6tShrUd2W5YVQfVoXb1KzNbXuXVFDpzXH40hWo9Q+6Rwt B2nG/etfJCfCRH5qQ85U4hdXGQDdeFDtHYuOcwlI= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/108802] [10/11/12/13 Regression] missed inlining of call via pointer to member function Date: Tue, 21 Feb 2023 12:39:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority cf_reconfirmed_on everconfirmed bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108802 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 Last reconfirmed| |2023-02-21 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #3 from Richard Biener --- That means it was a conscious decision. IPA function summary for f1():: [with auto:1 =3D int (A::*)(int)]/1 inlinable global time: 30.500000 self size: 23 global size: 25 the body is [local count: 1073741824]: _1 =3D f_18(D)->__pfn; _2 =3D (long int) _1; _3 =3D _2 & 1; if (_3 !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: _4 =3D __closure_19(D)->__a; _5 =3D f_18(D)->__delta; _6 =3D (sizetype) _5; _7 =3D _4 + _6; _8 =3D *_7; _9 =3D _2 + -1; _10 =3D (sizetype) _9; _11 =3D _8 + _10; iftmp.0_20 =3D *_11; [local count: 1073741824]: # iftmp.0_16 =3D PHI _12 =3D __closure_19(D)->__a; _13 =3D f_18(D)->__delta; _14 =3D (sizetype) _13; _15 =3D _12 + _14; _22 =3D iftmp.0_16 (_15, 42); return _22; so it is quite large. While we can give inline incentives in IPA inlining we do not discover the inline target there - the above has it also well obfuscated. Maybe we can still compute the set of functions possibly called here and perform speculative inlining in IPA? Maybe the frontend can also improve the initial IL which looks like < =3D (((long int) f->__pfn & 1) !=3D 0) ? = (int A:: (struct A *, int) *) *(*((int (*) () * *) a + (sizetype) f->__del= ta) + (sizetype) ((long int) f->__pfn + -1)) : f->__pfn ((struct A *) a + (sizetype) f->__delta, 42)>>;=