From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AD773857C6E; Fri, 19 Nov 2021 23:21:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AD773857C6E From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/103227] [12 Regression] 58% exchange2 regression with -Ofast -march=native on zen3 since r12-5223-gecdf414bd89e6ba251f6b3f494407139b4dbae0e Date: Fri, 19 Nov 2021 23:21:21 +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: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm 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: 12.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 23:21:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103227 --- Comment #7 from Martin Jambor --- (In reply to hubicka from comment #5) > > I like the idea of transformation phases better than putting > > everything into tree-inline (and by extension ipa-param-manipulation) > > but perhaps we have to do aggregate constant replacements there too? >=20 > So the situation is that we inline call A->B (where both A and B are > clones of the main function) and while we place uses of the constant > parmater in A we miss replacement in B because transform is not run on > it. No, we miss it everywhere, even in A (see that the code above is from BB 2) or probably also without any cloning whatsoever. This happens when IPA-SRA does its thing on the same parameter on which IPA-CP decided to propagate aggregate constants. In the IPA analysis stage (which creates the virtual clones), IPA-CP runs before IPA-SRA. But in the transformation phase, it is apparently the other way round - well, not exactly, IPA-SRA does not formally have a transformation phase, it happens as part of tree_function_versioning, but the effect is the same. >=20 > I think proper solution here (discussed also few years ago) is to keep > the optimization summaries and teach value numbering to look up the > constant from the summary. >=20 Yes, but this is another (but different) problem that we probably also should try to solve now.=