[llvm] [AArch64] Lower jump table cases threshold to 10 (PR #143632)

Guy David via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 23:59:03 PDT 2025


https://github.com/guy-david updated https://github.com/llvm/llvm-project/pull/143632

>From 54232b85ea35e4874e0e434a0426f48d172ea061 Mon Sep 17 00:00:00 2001
From: Guy David <guyda96 at gmail.com>
Date: Mon, 9 Jun 2025 14:05:06 +0300
Subject: [PATCH] [AArch64] Lower jump table cases threshold to 10

Previous stabs at this setting hypertuned it for SPEC2017, but Clang's
own compilation can benefit from a slightly lower threshold, yielding
a 0.3% improvement in compile time, while still not regressing SPEC.

Most notable benefactors of this change are:
 - llvm::Instruction::getNumSuccessors (11 cases)
 - llvm::Instruction::getSuccessor (11 cases)
---
 llvm/lib/Target/AArch64/AArch64Subtarget.cpp | 2 +-
 llvm/test/CodeGen/AArch64/min-jump-table.ll  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
index a28e6bad0dca0..68ed10570a52f 100644
--- a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
+++ b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
@@ -73,7 +73,7 @@ static cl::opt<AArch64PAuth::AuthCheckMethod>
                                cl::values(AUTH_CHECK_METHOD_CL_VALUES_LR));
 
 static cl::opt<unsigned> AArch64MinimumJumpTableEntries(
-    "aarch64-min-jump-table-entries", cl::init(13), cl::Hidden,
+    "aarch64-min-jump-table-entries", cl::init(10), cl::Hidden,
     cl::desc("Set minimum number of entries to use a jump table on AArch64"));
 
 static cl::opt<unsigned> AArch64StreamingHazardSize(
diff --git a/llvm/test/CodeGen/AArch64/min-jump-table.ll b/llvm/test/CodeGen/AArch64/min-jump-table.ll
index 98b89210f5a05..7cdff6e435f7e 100644
--- a/llvm/test/CodeGen/AArch64/min-jump-table.ll
+++ b/llvm/test/CodeGen/AArch64/min-jump-table.ll
@@ -105,7 +105,7 @@ entry:
 ; CHECK4-NEXT: Jump Tables:
 ; CHECK8-NEXT: Jump Tables:
 ; CHECK12-NEXT: Jump Tables:
-; CHECK-DEFAULT-NOT: {{^}}Jump Tables:
+; CHECK-DEFAULT: {{^}}Jump Tables:
 
 bb1: tail call void @ext(i32 1, i32 0) br label %return
 bb2: tail call void @ext(i32 2, i32 2) br label %return



More information about the llvm-commits mailing list