From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 418CB3857B9B; Mon, 10 Jul 2023 11:27:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 418CB3857B9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688988426; bh=vxbSaAzuMgGPQ2Fi0LfJvyitwU9SEAOd5IaBezCqnCs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uj9FE01f4fy2SWDOWwmYZwq9s2nW71MwFpCLh9h23wXMtsjOYB+YEw0eEFuKp/8/Y O5W6p0YegO7n6rRm4UzGwqULpAkmPUDzMShz4dpAQR1dxRTcjXcqs3K7LpA2Ys6Tjf IkFWiOxx1QP9CERedAG0pOo/96pPqdn+ERdxxHYc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109154] [13/14 regression] jump threading de-optimizes nested floating point comparisons Date: Mon, 10 Jul 2023 11:27:05 +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: P2 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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 #64 from Richard Biener --- (In reply to Tamar Christina from comment #63) > > > It looks like `-fno-tree-pre` does the trick, but then of course, mes= ses up > > > elsewhere. The conditional statement seem to stay in the most compli= cated > > > form possible in scalar code. > > >=20 > > > I'll try to track down what to turn off and experiment with a pre2 af= ter > > > vect. > > > Is before predcom a good place? > >=20 > > I would avoid putting it into the loop pipeline. Instead I'd turn the > > FRE pass that runs after tracer into PRE. Maybe conditional on whether > > there are any loops. > >=20 > > Note it's not so easy to "tame" PRE, the existing things happen at > > elimination time in eliminate_dom_walker::eliminate_stmt. I would > > experiment with restricting the use of inserted PHIs in innermost(!) > > loops containing invariants, maybe only if the number of PHI args is > > more than two ... (but that's somewhat artificial). > >=20 > > That said, I'm not really convinced this is a good idea. >=20 > I hear you.. there's also the added complexity that this likely only is > beneficial for fully masked architectures. I wonder, if it might be > feasible and better to pass on additional information from pre to ifcvt to > indicate that the operation was created from a common block. >=20 > In which case ifcvt could move the cond to just before the first shared > statement? I don't think PRE "knows" where the operation was created from since it's transforms from a global dataflow problem solution. Btw, what's the testcase your last examples are from?=