From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4DA73858D3C; Mon, 6 Nov 2023 20:23:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4DA73858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699302197; bh=C/9RVTlmoIryLOe6wOM/qAnkHfV6smOii1fk8rIkoGQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=F47AbFmXkg+0jHH5Ef8wwupu7oPTTQt4KUbAztzURX30DLVvjLr2MSV1BrxCU1DPZ Ogx9CEPQXkFUwFsOBsxlg4tUJG4vVqnkUe1XNk6NaDIYw8gxxOoUjy1+4X5KI9ejXH NVZS+d5JDuHxBHvIXU1ONs5GFi4QQuBIu+AJdSE8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112324] phiopt fail to recog if (b < 0) max = MAX(-b, max); else max = MAX (b, max) into max = MAX (ABS(b), max) Date: Mon, 06 Nov 2023 20:23:17 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D112324 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > (In reply to Andrew Pinski from comment #3) > > Note a simple patch to improve phiopt here does not improve the original > > code in openjpeg. > >=20 > > The reason why is due to the code in phiopt here is only operates on the > > case where the phi would be the only one. In that case we also have a v= op > > phi which changes which causes the code not to be done. >=20 > But maybe ifcvt could use the same function to do the transformation befo= re > it does the conversion ... I will try to figure that out next but I want to get this patch though.=