From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DEA563858C2C; Mon, 29 Aug 2022 15:25:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA563858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661786744; bh=o9Uh8CN7qfpdKgHWy+bnl1PV1ilZ5Vza9fB+79ZsYno=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BY35ERYov2cdcrzUmBjjeVKHCOnoX8Y2wJCLrcsx0PrIl97nDtPkNgWMROXIcsHSJ I+FBxMv2GV6Z+lhpD+WEcuE1yC6EMZiZDEd5J7I4QMbs9lyISpXdwWqK6qrsKZchvP TlvdG8bnwcOXSZYKXvVP8Jl3aVSqNVnUEv/c/KAg= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/91213] Missed optimization: (sub X Y) -> (xor X Y) when Y <= X and isPowerOf2(X + 1) Date: Mon, 29 Aug 2022 15:25:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 10.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=3D91213 --- Comment #7 from Andrew Pinski --- (In reply to rdapp from comment #6) > What's the mechanism to get range information at RTL level? The only rela= ted > thing I saw in (e.g.) simplify-rtx.cc is nonzero_bits and this does not s= eem > to be propagated from gimple. You can get it at expand time, is that enough? Which I think the patch I ha= d. As far as nonzero_bits there is a project being working by Segher but I don= 't know the status of it.=