From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF873385843E; Thu, 20 Jan 2022 14:42:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF873385843E From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102540] [12 Regression] Dead Code Elimination Regression at -O3 since r12-476-gd846f225c25c5885 Date: Thu, 20 Jan 2022 14:42:29 +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: 12.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: 12.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2022 14:42:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102540 --- Comment #10 from Andrew Macleod --- (In reply to Richard Biener from comment #9) > I think the GCC 12 IL would require tracking equivalences on parts of > registers, > in this case that _2 is equal to the low part of a.0_1. That is, one wou= ld > need to extend what CCP does with bit propagation to include equivalences. >=20 I have in my workqueue some thoughts for GCC13 where we can track partial equivalences so we can see through different casts and masks.=20 a.0_1 =3D a; _2 =3D (unsigned int) a.0_1; b =3D _2; _6 =3D a.0_1 & 4294967295; c_10 =3D _6; if (c_10 !=3D 0) goto ; [INV] _2 would be a 32 bit equivalence with a.0_1 generated by op_cast, and _6 would also be a 32 bit equivalence with a.0_1 generated op_bitwise_and. They would all end up in the same partial equivalence set. and when a range for anything in that set falls into the bitrange of the equivalence size, like the [0,0] , then it can be applied (with some restrictions), to other members of the set. Its an extension of some thou= ght I had for trying to relates different size casts to each other, just extend= ed to include masking. There is a series of other PRs which would be fixed by this sort of ability= . it has become prevalent enough to warrant the work I think. (Also 79191 91881 102705 102872)=