From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA38A3858D28; Tue, 30 May 2023 20:40:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA38A3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685479201; bh=OUrJhTRWB5REp+460VRLQqWp72DrM9JejJCX9emapRE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fmckz3tnIKduE9Nx/EYwhH9QvupxAsVRUQSUWONinyyL7xTM+M/fPXlOOCFO56xe+ S3tRODewKcl5Z4dYjvzZhyPREJcvPR21HhTxXtERkga6GYEAmjB9dTxstIq6GlRV1U ywYRRt1ULwf82r6/ohDxuXGSkFK0CJe/9Tmhbn+s= From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/109592] Failure to recognize shifts as sign/zero extension Date: Tue, 30 May 2023 20:40:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: law 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=3D109592 --- Comment #9 from Jeffrey A. Law --- Weird, I don't see the attachment either. I'll extract & upload it again. WRT costing. fwprop and combine will both query the target rtx costs and w= ill reject when the target costing model indicates the change isn't actually profitable. As you'd noted before, combine will internally transform a sign/zero extens= ion into a pair of shifts. The whole point of that internal canonicalization i= s to expose cases where the shifts can combine with other nearby operations. So there's no significant risk to detecting and creating the extension form earlier.=