From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BDFBD3858D28; Wed, 9 Nov 2022 16:04:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDFBD3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668009855; bh=y8gFmckis/v3XEPPED1jq/ZRyrNyx+gombpNV/thrvQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CYhJgp+k17PV9CD94hhkh9NkmYb/XwhPsyX2OE+yg3E9J2KbEU1MMN3r9b3vDVMmN LqsIKZ2qmJMUaVxAxhAL3XSahUs85Gk4hd8MQEpTJ45Rg/aWO5IAxj9F/6FsxM3nz0 S6EiNWig+wjGvtMs4w9b3eWFYxaHIMp8eYsixCPc= From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107591] range-op{,-float}.cc for x * x Date: Wed, 09 Nov 2022 16:04:15 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh 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=3D107591 --- Comment #6 from Aldy Hernandez --- (In reply to Jakub Jelinek from comment #2) > Perhaps before we try to map MULT_EXPR into some irange/frange op the usu= al > way, > while we still have access to gimple statement check if it is MULT_EXPR w= ith > the same operands and use a different artificial unary op for pow2. > We could do this for PLUS_EXPR x + x as well and handle it as 2 * x if we > don't do that already or if match.pd doesn't already canonicalize x + x t= hat > way. FYI, the range operators have a relation field, so it should be able to tell you that both operands are equal with VREL_EQ (?). You could use that to optimize things.=