From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3FA1D3850438; Tue, 28 Mar 2023 15:53:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FA1D3850438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680018818; bh=SBbXJSFn/8dZgWLG3IAZrDGgJ9MT64ad6lgA/RH77+k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GNFQMrP9o06MiBh2qCr5Xxj6zQtb1YPQ2uNz0q8WmlKGBmHARXnjeeUu41YIfbtqw AEzH65NZhFXDWoq2BTSx3/r0Ro566+gZpwkewqq5NNfTYS0BKluMn4U/4YsjLfmPHr 9O1x2u5E9ZGu9kE8z77U9RNnrJaP+vPPPg4icxRc= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109154] [13 regression] jump threading de-optimizes nested floating point comparisons Date: Tue, 28 Mar 2023 15:53:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com 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: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109154 --- Comment #34 from Andrew Macleod --- (In reply to Jakub Jelinek from comment #33) > (In reply to Andrew Macleod from comment #32) > > We could in theory expand it to look at 2 levels if its a single operan= d... >=20 > Yeah, that would help here and could be worth it. >=20 > > which will help with some of these cases where there are casts, and kee= p the > > performance degradation from being too bad. I'm sure there will be ca= ses > > where a third would be handy :-P >=20 > And/or, could we go from seeing zone1_12 in an PHI arg and in that case w= alk > a level or two or three to see if it is dependent on an SSA_NAME known to > have specific range on the edge and if so, do those range queries using t= hat > range? well, its knowing it has a specific ranges that is the not-cheap part. For every one we find a useful range, therea re likely many queries that do not fina anything useful. and every level of indirection adds to that. So we know zone1_12 uses _2, we can see that it is a recomputable value, but without outgoing edge values cached, we have to actually calculate it. Un= til we calculate it, we dont know that its going to help us.. we just know it *= can* be recomputed, not that its useful. Even if we limited it to just PHI arguments (which specializing is not easy btw), that means every PHI argument could have additional 2nd level checks = and recomputations, many of which are not useful. I will poke at whether its possible to cheaply handle a second (or third) l= evel for single dependency defs.=