[llvm] [AArch64][LV] Cost low-VF interleaved access (PR #205844)

Jack Styles via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 03:09:35 PDT 2026


================
@@ -0,0 +1,71 @@
+; RUN: opt -passes=loop-vectorize -mtriple=aarch64-linux-gnu -mattr=+sve -debug-only=loop-vectorize -disable-output %s 2>&1 | FileCheck %s
+; REQUIRES: asserts
+
+target triple = "aarch64"
+
+; Cost-model test for the path where the interleave factor is > the VF.
+; The cost is modelled as a contiguous load of the wide vector plus a
+; vector.deinterleave4 lowered as a binary tree of (Factor - 1) deinterleave2 shuffles:
+;
+;   cost = MemCost + (Factor - 1) * LT.first
+;  * VF vscale x 2: wide type <vscale x 8 x i16>, LT.first = 1
+;       => 1 (load) + 3 * 1 (shuffles) = 4
+;  * VF vscale x 4: wide type <vscale x 16 x i16> LT.first = 2
+;       => 2 (loads) + 3 * 2 (shuffles) = 8
+
+; CHECK-LABEL: LV: Checking a loop in 'deinterleave4_nxv2i16_load'
+; CHECK: Cost of 4 for VF vscale x 2: INTERLEAVE-GROUP with factor 4, ir<%ptr.b>
+; CHECK: Cost of 8 for VF vscale x 4: INTERLEAVE-GROUP with factor 4, ir<%ptr.b>
----------------
Stylie777 wrote:

Is there a way here for us to test which VF is being chosen I think thats good to include so its clear this test is expecting VF=2 is selected.

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


More information about the llvm-commits mailing list