[llvm] [AArch64] Enable SVE MaxBW for Neoverse-N2, prefer fixed at same cost (PR #195108)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 08:26:52 PDT 2026


https://github.com/huntergr-arm created https://github.com/llvm/llvm-project/pull/195108

This should be using the same settings as other 128b SVE cores. Very slight
performance improvement from MaxBW, regressions alleviated by preferring
fixed VFs over scalable when they're the same cost.


>From 6e7dbe77293951e3f5cd82ea9eaa9d9e905ba8d5 Mon Sep 17 00:00:00 2001
From: Graham Hunter <graham.hunter at arm.com>
Date: Tue, 28 Apr 2026 14:13:01 +0000
Subject: [PATCH] [AArch64] Enable SVE MaxBW for Neoverse-N2, prefer fixed at
 same cost

This should be using the same settings as other 128b SVE cores. Very slight
performance improvement from MaxBW, regressions alleviated by preferring
fixed VFs over scalable when they're the same cost.
---
 llvm/lib/Target/AArch64/AArch64Processors.td                    | 2 +-
 .../AArch64/force-scalable-vectorization-always.ll              | 2 +-
 .../LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64Processors.td b/llvm/lib/Target/AArch64/AArch64Processors.td
index 74b2700d08fd1..d7b842a3c9313 100644
--- a/llvm/lib/Target/AArch64/AArch64Processors.td
+++ b/llvm/lib/Target/AArch64/AArch64Processors.td
@@ -690,7 +690,7 @@ def TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2
                                       FeatureALULSLFast,
                                       FeaturePostRAScheduler,
                                       FeatureEnableSelectOptimize,
-                                      FeatureDisableMaximizeScalableBandwidth,
+                                      FeatureUseFixedOverScalableIfEqualCost,
                                       FeaturePredictableSelectIsExpensive]>;
 
 def TuneNeoverseN3 : SubtargetFeature<"neoversen3", "ARMProcFamily", "NeoverseN3",
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll b/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll
index c90d00389430d..cb2b67faa2d46 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Checking a loop in" --filter "Cost for VF" --filter "Final VPlan for" --filter "Selecting VF:" --version 6
-; RUN: opt -passes=loop-vectorize -enable-epilogue-vectorization=false -scalable-vectorization=always -debug-only=loop-vectorize -disable-output %s 2>&1 | FileCheck %s
+; RUN: opt -passes=loop-vectorize -enable-epilogue-vectorization=false -mattr=disable-maximize-scalable-bandwidth -scalable-vectorization=always -debug-only=loop-vectorize -disable-output %s 2>&1 | FileCheck %s
 ; REQUIRES: asserts
 
 target triple = "aarch64"
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
index c1b175f39e852..01749e5453493 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
@@ -17,7 +17,7 @@
 
 ; RUN: opt -mtriple=aarch64 -mcpu=neoverse-n2 \
 ; RUN:     -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize --disable-output < %s 2>&1 \
-; RUN:     | FileCheck %s --check-prefixes=VSCALEFORTUNING1
+; RUN:     | FileCheck %s --check-prefixes=NEOVERSEV2
 
 ; RUN: opt -mtriple=aarch64 -mcpu=neoverse-v2 \
 ; RUN:     -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize --disable-output < %s 2>&1 \



More information about the llvm-commits mailing list