From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 25299384CB97; Wed, 15 May 2024 09:05:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25299384CB97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715763946; bh=RRtWpqlmqsg0posJsxhFZsw2v1B9MoRSqPSMasXfzco=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Nvjhsp/bAYeLhDM8NPJp1bzYhqfWZ7QvyMq1zpVN2CJUYSIOr3zYxTMJEOu/VbU64 mXDQkviPxrciSZ/Gf9GOLpdF3vytKNgCBQpaIElCW9iuHxYygb9AZER9u9V17VbWTL UQIWYyQAhRm3Z0+2N5CDTRfok2IEt0akYgUbiixE= From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/115097] Strange suboptimal codegen specifically at -O2 when copying struct type Date: Wed, 15 May 2024 09:05:43 +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: 15.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D115097 --- Comment #7 from Jan Hubicka --- > and then we inline them back, introducing the extra copy. Why do we use > tail-calls here instead of aliases? Why do we lack cost modeling here? Because the function is exported and we must keep addresses different. Cost modeling is somewhat hard here, since it is not clear what will help inliner and whether inliner will inline back. For example if we icf two function calling third function. the third one may become called once and we get better code by inlining it and eliding offline copy rather than keeping the caller duplicated. So the idea is to get code into as canonical form as possible (with no obvious duplicates) and then let the inliner heuristics to decide what should and what should not be duplicated in the final code.=