From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DF5D8385B537; Tue, 15 Aug 2023 15:41:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF5D8385B537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692114103; bh=aI6y05Kmn9QS5MLaGcUBY1A+/zELHwwz4aKEuzoFdLY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A1Ubikfgvu79Uqmg85E9p/aVSZJ+6TcV0UfHzF1Ss2jjBpmOjEAClwV3FMLz4c1n3 x/6y2sDwxtHpGx7PvU4i8H/+xcNb/594kIidBhFTXbpTcvEPGHLmpcnp25dJ9m+xR1 pMZaactPTRYN0nWkeYHnIPbTnHnl6OPen6bb552E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/68930] Aggregate replacements not applied to inline function bodies. Date: Tue, 15 Aug 2023 15:41:42 +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: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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=3D68930 --- Comment #10 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:d073e2d75d9ed492de9a8dc6970e5b69fae20e5a commit r14-3226-gd073e2d75d9ed492de9a8dc6970e5b69fae20e5a Author: Martin Jambor Date: Tue Aug 15 17:26:13 2023 +0200 Feed results of IPA-CP into tree value numbering PRs 68930 and 92497 show that when IPA-CP figures out constants in aggregate parameters or when passed by reference but the loads happen in an inlined function the information is lost. This happens even when the inlined function itself was known to have - or even cloned to have - such constants in incoming parameters because the transform phase of IPA passes is not run on them. See discussion in the bugs for reasons why. Honza suggested that we can plug the results of IPA-CP analysis into value numbering, so that FRE can figure out that some loads fetch known constants. This is what this patch attempts to do. The patch does not attempt to populate partial_defs with information from IPA-CP, this can be hopefully added as a follow-up. gcc/ChangeLog: 2023-08-11 Martin Jambor PR ipa/68930 PR ipa/92497 * ipa-prop.h (ipcp_get_aggregate_const): Declare. * ipa-prop.cc (ipcp_get_aggregate_const): New function. (ipcp_transform_function): Do not deallocate transformation inf= o. * tree-ssa-sccvn.cc: Include alloc-pool.h, symbol-summary.h and ipa-prop.h. (vn_reference_lookup_2): When hitting default-def vuse, query IPA-CP transformation info for any known constants. gcc/testsuite/ChangeLog: 2023-06-07 Martin Jambor PR ipa/68930 PR ipa/92497 * gcc.dg/ipa/pr92497-1.c: New test. * gcc.dg/ipa/pr92497-2.c: Likewise.=