From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AF7038582BE; Wed, 29 Mar 2023 06:38:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AF7038582BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680071899; bh=Vbngo5MJmzOLXP+00tZFPnF+ekBX/W91kWwMdWXQOMI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NOOqJLXRLdbrrGcjgh+g1wQsanDuNLyKBdbNEDLA2262+OVHQnVEUQ9r3CsBL8Zom 3aC4IuicKmQijO2Ht/l/gAFGaVmg4CvYMlIU0yA/HTLI09wAL++6lGoRhci4ADKf4f bZOCkIv9hzFqjSzdR+iLZeYVQQ8S5K+KCjYTj9TE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109154] [13 regression] jump threading de-optimizes nested floating point comparisons Date: Wed, 29 Mar 2023 06:38:18 +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: rguenth 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: 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 #39 from Richard Biener --- (In reply to Andrew Macleod from comment #37) > Created attachment 54780 [details] > in progress patch >=20 > Well call me a liar.=20 >=20 > It took me a while to understand why, but if we leave it to single > dependencies only, the impact is relatively linear. I wrote a bunch of > code, then deleted most of it as I found the engine was bypassing my code > and doing it on its own. >=20 > The attached patch is the core. It actually works to a depth of 5 > recomputations. my sample of: > int a =3D left * 2; > int b =3D a - 4; > int c =3D b % 7; > func (a,b ,c); > int d =3D c * 4; > if (left =3D=3D 20) > { > func (b,c,d); >=20 > produces=20 > : > func (36, 1, 4); >=20 > IT also changes your program somewhat. >=20=20 > Try applying it and see if it does what you want. It bootstraps, regressi= on > are running.. but based on the minimal code impact, I wouldn't expect > incorrect failures. >=20 > Performance impact on building GCC is barely half a percent in VRP, and > 0.05% overall compile time. pretty minimal. >=20 > Im still working with it to tweak it, I just wanted you to be able to see= if > it helps. I presume we dont want to add a new --param this late in the > game. But it seems we can set a reasonable number and not run into much > trouble. There is no problem with adding --params, and those are always better than magic numbers. Btw, I originally wondered why we don't re-compute zone1_12 because it's in the imports of the successor (OK, the empty successors single successor block) and expected those to trigger re-computes.=