From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51D57386D61F; Tue, 28 May 2024 22:59:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51D57386D61F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716937165; bh=vmQ6jcuNpXCxWeUtD6exjOyNELAffAVroAA9Opz0QTU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VuPpjq6uGDZki2bgixs51V32TSkedKHlv0I3tt8ba7J4z0ZI0nVK+Ck+Vk68nmYAJ QAjBmDzTbrlU7nb1X5CkUWndCgaGCT/cXgDOzsWO/xWtDKfUBJwDIAY4w+qu7NeEpY LcaGOT6O7mg4nDsPHEwCZ/SiHyj5aRj74CfgD2bg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67325] Optimize shift (aka subreg) of load to simple load Date: Tue, 28 May 2024 22:59:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D67325 --- Comment #6 from GCC Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:1d6199e5f8c1c08083eeb0279f71333234fe14ad commit r15-882-g1d6199e5f8c1c08083eeb0279f71333234fe14ad Author: liuhongt Date: Mon Feb 19 13:57:24 2024 +0800 Reduce cost of MEM (A + imm). For MEM, rtx_cost iterates each subrtx, and adds up the costs, so for MEM (reg) and MEM (reg + 4), the former costs 5, the latter costs 9, it is not accurate for x86. Ideally address_cost should be used, but it reduce cost too much. So current solution is make constant disp as cheap as possible. gcc/ChangeLog: PR target/67325 * config/i386/i386.cc (ix86_rtx_costs): Reduce cost of MEM (A + imm) to "cost of MEM (A)" + 1. gcc/testsuite/ChangeLog: * gcc.target/i386/pr67325.c: New test.=