From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CD593858014; Tue, 28 Nov 2023 22:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CD593858014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701210297; bh=ehTWOz9GZdYIoBKthzmjlYagSpUVDqxQDu8oFR99UyA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qkh8/DgLGwIoeYeRzxxNGv9oGypNDCfSILQiqWDAJa7yry7nNAVwq4eq5vxr/98A9 bzTkEJjinmw5Wot24N3Rs8/J7sfaG+CSpyT48mU95Ok6rBEeNmrl4U2StqN6+ATjcW LDRakgTa68reH+teLWqYdETyBF+ciBRICTCktRec= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/52252] An opportunity for x86 gcc vectorizer (gain up to 3 times) Date: Tue, 28 Nov 2023 22:24:56 +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: 4.7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: --- 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=3D52252 --- Comment #12 from Andrew Pinski --- (In reply to rguenther@suse.de from comment #11) > We're lacking a way to say one of the bit_not should be single-used, > one multi-use would be OK and a fair trade-off - not sure if that > would be enough here, of course. That would mena changing to > a condition with single_use (). That does not fix it though. Because in this case we have: c_19 =3D ~r_16; m_20 =3D ~g_17; y_21 =3D ~b_18; tmp_22 =3D MIN_EXPR ; k_23 =3D MIN_EXPR ; _1 =3D c_19 - k_23; _3 =3D m_20 - k_23; _5 =3D y_21 - k_23; .. =3D k_23; So both bit_not are used more than once. so we have `~a - MIN, ~c>` which is the same as `MAX,c= > - a`. Let me file this as a seperate bug to continue the discussion there.=