[llvm] [AArch64] Account for fixed-SVE high-lane insertelement/extractelement costs (PR #219244)

Utpal Bora via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 08:50:59 PDT 2026


================
@@ -0,0 +1,25 @@
+; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -mtriple=aarch64-unknown-linux-gnu -mattr=+sve2 \
+; RUN:     -aarch64-sve-vector-bits-min=256 -aarch64-sve-vector-bits-max=256 \
+; RUN:     -disable-output < %s 2>&1 | FileCheck %s --check-prefix=DEBUG
+
+define void @shell_(i64 %0) {
+  br label %2
+
+2:                                                ; preds = %2, %1
+  %3 = phi i64 [ %10, %2 ], [ 0, %1 ]
+  %4 = phi float [ %9, %2 ], [ 0.000000e+00, %1 ]
+  %5 = mul nuw i64 %3, 20
+  %6 = getelementptr i8, ptr null, i64 %5
+  %7 = load float, ptr %6, align 4
+  %8 = fmul float 0.000000e+00, %7
+  %9 = call float @llvm.maxnum.f32(float %4, float %8)
+  %10 = add i64 %3, 1
+  %11 = icmp eq i64 %3, %0
+  br i1 %11, label %12, label %2
+
+12:                                               ; preds = %2
+  ret void
+}
+
+declare float @llvm.maxnum.f32(float, float)
+; DEBUG: LV: Selecting VF: 4.
----------------
utpalbora wrote:

Good catch, it does. fixed.

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


More information about the llvm-commits mailing list