From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9FAC03858C2F; Mon, 10 Jul 2023 11:02:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FAC03858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688986965; bh=EsSpG9tYdxJQ6xoU5cP/v2qJGhHiHFJEGUF1lKCGARo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e/PMf0CbDlLH45Fn8xWhB4+dvAP8AjNFZR3t2G5y9uLth2HzFiDqHB6+LIaADUXIY V/1CShLTNMlGKbsMeeqO5+XrFe4AaSzd4yjJ/mPgqbuKswUJlXB48XVk/eI7fMFoz/ iEUKl8SqX1gMEnuXvxIlI12AGmdaL0rY5rByChpg= From: "tnfchris 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:02:45 +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: tnfchris 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 #63 from Tamar Christina --- > > It looks like `-fno-tree-pre` does the trick, but then of course, messe= s up > > elsewhere. The conditional statement seem to stay in the most complica= ted > > form possible in scalar code. > >=20 > > I'll try to track down what to turn off and experiment with a pre2 after > > 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. 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 feasib= le and better to pass on additional information from pre to ifcvt to indicate = that the operation was created from a common block. In which case ifcvt could move the cond to just before the first shared statement?=