[llvm] [AArch64] Enable maximize vector bandwidth for Neoverse-V1, V2 and N1 (PR #166748)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 03:35:44 PST 2025


================
@@ -371,8 +371,17 @@ AArch64TTIImpl::getInlineCallPenalty(const Function *F, const CallBase &Call,
 bool AArch64TTIImpl::shouldMaximizeVectorBandwidth(
     TargetTransformInfo::RegisterKind K) const {
   assert(K != TargetTransformInfo::RGK_Scalar);
-  return (K == TargetTransformInfo::RGK_FixedWidthVector &&
-          ST->isNeonAvailable());
+
+  if (K == TargetTransformInfo::RGK_FixedWidthVector && ST->isNeonAvailable())
+    return true;
+
+  switch (ST->getProcFamily()) {
+  case AArch64Subtarget::NeoverseN2:
----------------
david-arm wrote:

For stuff like this we normally have a separate boolean in AArch64Subtarget I think, and initialise the boolean according to the target. See `EpilogueVectorizationMinVF` for example. That way you can just do:

```
  return K == TargetTransformInfo::RGK_ScalableVector && ST->shouldMaximiseSVEBandwith())

https://github.com/llvm/llvm-project/pull/166748


More information about the llvm-commits mailing list