From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 720973857C66; Thu, 15 Jun 2023 08:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 720973857C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686817497; bh=7QhJ3c2D8LNhvKvUn0w/XamRFQVXSBp27FrCMn+bpPI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uDIFpTBnUgdyxM+//cKQ2r+bzMIQKht5oeF2YZ1st/ZqK9OIDVuz5Z/hwv9+k5DMX 0sACcNRGwPZ+7DW/zSMyh1swmd44JIZmsQQSPYrvsUG886XlV0+PyX7HhgbQEqTv7F ErZdWl1R/uwqr+ynut2QDApH8Fd8kh+9qYkLue+M= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110136] After optimization, the $r1 register will be broken when jumping to the jump table, resulting in a significant increase in the false prediction rate of branch prediction. Date: Thu, 15 Jun 2023 08:24:54 +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: 12.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D110136 --- Comment #6 from CVS Commits --- The releases/gcc-12 branch has been updated by LuluCheng : https://gcc.gnu.org/g:ddec24e5abe99033c8d6bbe544b4c2b35a0232f2 commit r12-9698-gddec24e5abe99033c8d6bbe544b4c2b35a0232f2 Author: Lulu Cheng Date: Wed Jun 7 10:21:58 2023 +0800 LoongArch: Avoid non-returning indirect jumps through $ra [PR110136] Micro-architecture unconditionally treats a "jr $ra" as "return from subroutine", hence doing "jr $ra" would interfere with both subroutine return predic= tion and the more general indirect branch prediction. Therefore, a problem like PR110136 can cause a significant increase in branch error prediction rate and affect performance. The same problem exists with "indirect_jump". gcc/ChangeLog: PR target/110136 * config/loongarch/loongarch.md: Modify the register constraints for template "jumptable" and "indirect_jump" from "r" to "e". Co-authored-by: Andrew Pinski (cherry picked from commit 5430c86e71927492399129f3df80824c6c334ddf)=