From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D033389901B; Fri, 7 Oct 2022 01:41:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D033389901B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665106872; bh=DxG9cdb8gEz5l2X7sHtvdcQtgVHWTiTgGAOJacDzHBA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J4lGNBBKZl/xrZyjSgrBeNuWT/pXuNN1aLQLNuTCdZDgq3/9/X8Dib1M44hsH6m6L bXpkrqpt4pDbrS230PobF2rkQ7mJyfnOJAXsYf3kl3nKLKVqPKUPgoV/PAQMGGGuMD G3JfSCn2EjYWbFTVRIFcF3VPYQOTPZXAm0e1WzgI= From: "unlvsur at live dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107167] It looks like GCC wastes registers on trivial computations when result can be cached Date: Fri, 07 Oct 2022 01:41:09 +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: enhancement X-Bugzilla-Who: unlvsur at live dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D107167 --- Comment #6 from cqwrteur --- (In reply to Andrew Pinski from comment #5) > You already filed this one. >=20 > *** This bug has been marked as a duplicate of bug 103550 *** (In reply to Andrew Pinski from comment #1) > This is a reassociation, scheduling issue and register allocation issue. >=20 > Plus your example might be slower due to dependencies. >=20 > Without a full example of where gcc ra goes wrong, gcc actually produces > much better code for this example due to register renaming in hw. > Note many x86_64 also does register renaming for the stack too On x86_64, I just checked uops.info, only two ports are available for rotr,rotl. They cannot really get paralleled executed.=