[llvm] [LV][NFC] Autogen a test with integer costs per lane (PR #201560)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 05:17:17 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: David Sherwood (david-arm)

<details>
<summary>Changes</summary>

The test file

Transforms/LoopVectorize/WebAssembly/memory-interleave.ll

causes headache whenever the cost model gets changed. See PR #<!-- -->198252 as an example. I have tried to auto-generate the CHECK lines so that it's testing the same thing as before. It is more verbose and is testing more CHECK lines in some cases, but I believe this it's worth it in order to make the tests more manageable for developers.

As part of this I have also added two new DEBUG only flags in LoopVectorize.cpp:

1. -print-int-costs-per-lane. This flag forces the estimated cost per lane to be printed out as an integer to aid the creation of more robust CHECK lines that are hopefully less prone to failing due to difference in target FP rounding behaviour.

2. -vplan-dont-print-metadata. This flag avoids the metadata being printed out at the end of a recipe, which can lead to non-deterministic behaviour when included in auto-generated CHECK lines.

---

Patch is 171.36 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/201560.diff


3 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+11-1) 
- (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+8-1) 
- (modified) llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll (+1825-1330) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index fcfe11b6e9de6..cfabfce0ea2a2 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -375,6 +375,13 @@ cl::opt<bool> llvm::VPlanPrintVectorRegionScope(
              "`-vplan-print-after*` if the plan has one."));
 #endif
 
+#if !defined(NDEBUG)
+static cl::opt<bool> PrintIntCostsPerLane(
+    "print-int-costs-per-lane", cl::init(false), cl::Hidden,
+    cl::desc("When printing out debug containing the costs per lane use "
+             "integer values instead."));
+#endif
+
 // This flag enables the stress testing of the VPlan H-CFG construction in the
 // VPlan-native vectorization path. It must be used in conjuction with
 // -enable-vplan-native-path. -vplan-verify-hcfg can also be used to enable the
@@ -5769,7 +5776,10 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
                     << " (Estimated cost per lane: ");
   if (Cost.isValid()) {
     double CostPerLane = double(Cost.getValue()) / EstimatedWidth;
-    LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
+    if (PrintIntCostsPerLane)
+      LLVM_DEBUG(dbgs() << format("%.0f", CostPerLane));
+    else
+      LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
   } else /* No point dividing an invalid cost - it will still be invalid */
     LLVM_DEBUG(dbgs() << "Invalid");
   LLVM_DEBUG(dbgs() << ")\n");
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index badcd40daf46b..96d625faabc00 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -47,6 +47,13 @@ using VectorParts = SmallVector<Value *, 2>;
 #define LV_NAME "loop-vectorize"
 #define DEBUG_TYPE LV_NAME
 
+#if !defined(NDEBUG)
+static cl::opt<bool> VPlanDontPrintMetadata(
+    "vplan-dont-print-metadata", cl::init(false), cl::Hidden,
+    cl::desc("When printing out recipes avoid printing out metadata to avoid "
+             "potentially non-deterministic behaviour."));
+#endif
+
 bool VPRecipeBase::mayWriteToMemory() const {
   switch (getVPRecipeID()) {
   case VPExpressionSC:
@@ -1969,7 +1976,7 @@ void VPIRMetadata::intersect(const VPIRMetadata &Other) {
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void VPIRMetadata::print(raw_ostream &O, VPSlotTracker &SlotTracker) const {
   const Module *M = SlotTracker.getModule();
-  if (Metadata.empty() || !M)
+  if (Metadata.empty() || !M || VPlanDontPrintMetadata)
     return;
 
   ArrayRef<StringRef> MDNames = SlotTracker.getMDNames();
diff --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
index 6a0a3410a9585..989b5510d2f18 100644
--- a/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
+++ b/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
@@ -1,5 +1,6 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost of.*INTERLEAVE-GROUP" --filter "LV: Selecting VF:" --filter "Cost for VF" --filter "LV: Scalar loop costs" --filter "Cost of.*REPLICATE.*(load|store)" --filter "^  ir.*load from" --filter "^  store.*to index" --filter-out-after "LV: Selecting VF" --version 6
 ; REQUIRES: asserts
-; RUN: opt -mattr=+simd128 -passes=loop-vectorize -debug-only=loop-vectorize,vectorutils -disable-output < %s 2>&1 | FileCheck %s
+; RUN: opt -mattr=+simd128 -passes=loop-vectorize -debug-only=loop-vectorize,vectorutils -disable-output -print-int-costs-per-lane -vplan-dont-print-metadata < %s 2>&1 | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20"
 target triple = "wasm32-unknown-wasi"
@@ -18,24 +19,31 @@ target triple = "wasm32-unknown-wasi"
 %struct.TwoFloats = type { float, float }
 %struct.FourFloats = type { float, float, float, float }
 
-; CHECK-LABEL: two_ints_same_op
-; CHECK: LV: Scalar loop costs: 12.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK: Cost for VF 2: 27 (Estimated cost per lane: 13.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK: Cost for VF 4: 24 (Estimated cost per lane: 6.
-; CHECK: LV: Selecting VF: 4.
 define hidden void @two_ints_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'two_ints_same_op'
+; CHECK:  LV: Scalar loop costs: 12.
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:  Cost for VF 2: 27 (Estimated cost per lane: 14)
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:  Cost for VF 4: 24 (Estimated cost per lane: 6)
+; CHECK:  LV: Selecting VF: 4.
+;
   %5 = icmp eq i32 %3, 0
   br i1 %5, label %6, label %7
 
@@ -63,24 +71,31 @@ define hidden void @two_ints_same_op(ptr noalias nocapture noundef writeonly %0,
   br i1 %22, label %6, label %7
 }
 
-; CHECK-LABEL: two_ints_vary_op
-; CHECK: LV: Scalar loop costs: 12.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK: Cost for VF 2: 27 (Estimated cost per lane: 13.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK: Cost for VF 4: 24 (Estimated cost per lane: 6.
-; CHECK: LV: Selecting VF: 4.
 define hidden void @two_ints_vary_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'two_ints_vary_op'
+; CHECK:  LV: Scalar loop costs: 12.
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:  Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:  Cost for VF 2: 27 (Estimated cost per lane: 14)
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:  Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:  Cost for VF 4: 24 (Estimated cost per lane: 6)
+; CHECK:  LV: Selecting VF: 4.
+;
   %5 = icmp eq i32 %3, 0
   br i1 %5, label %6, label %7
 
@@ -108,18 +123,31 @@ define hidden void @two_ints_vary_op(ptr noalias nocapture noundef writeonly %0,
   br i1 %22, label %6, label %7
 }
 
-; CHECK-LABEL: three_ints
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 2: 61 (Estimated cost per lane: 30.
-; CHECK: Cost of 12 for VF 4: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 12 for VF 4: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 12 for VF 4: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.
-; CHECK: LV: Selecting VF: 1.
 define hidden void @three_ints(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'three_ints'
+; CHECK:  LV: Scalar loop costs: 16.
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%12> = load ir<%11>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%13>, ir<%14>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%16> = load ir<%15>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%18> = load ir<%17>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%19>, ir<%20>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%22> = load ir<%21>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%24> = load ir<%23>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%25>, ir<%26>
+; CHECK:  Cost for VF 2: 61 (Estimated cost per lane: 30)
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%10> = load ir<%9>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%12> = load ir<%11>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%13>, ir<%14>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%16> = load ir<%15>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%18> = load ir<%17>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%19>, ir<%20>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%22> = load ir<%21>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%24> = load ir<%23>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%25>, ir<%26>
+; CHECK:  Cost for VF 4: 115 (Estimated cost per lane: 29)
+; CHECK:  LV: Selecting VF: 1.
+;
   %5 = icmp eq i32 %3, 0
   br i1 %5, label %6, label %7
 
@@ -154,22 +182,41 @@ define hidden void @three_ints(ptr noalias nocapture noundef writeonly %0, ptr n
   br i1 %28, label %6, label %7
 }
 
-; CHECK-LABEL: three_shorts
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 2: 61 (Estimated cost per lane: 30.
-; CHECK: Cost of 12 for VF 4: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 12 for VF 4: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 12 for VF 4: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.
-; CHECK: Cost of 24 for VF 8: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 24 for VF 8: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 24 for VF 8: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 8: 223 (Estimated cost per lane: 27.
-; CHECK: LV: Selecting VF: 1.
 define hidden void @three_shorts(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'three_shorts'
+; CHECK:  LV: Scalar loop costs: 16.
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%12> = load ir<%11>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%13>, ir<%14>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%16> = load ir<%15>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%18> = load ir<%17>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%19>, ir<%20>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%22> = load ir<%21>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%24> = load ir<%23>
+; CHECK:  Cost of 6 for VF 2: REPLICATE store ir<%25>, ir<%26>
+; CHECK:  Cost for VF 2: 61 (Estimated cost per lane: 30)
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%10> = load ir<%9>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%12> = load ir<%11>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%13>, ir<%14>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%16> = load ir<%15>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%18> = load ir<%17>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%19>, ir<%20>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%22> = load ir<%21>
+; CHECK:  Cost of 12 for VF 4: REPLICATE ir<%24> = load ir<%23>
+; CHECK:  Cost of 12 for VF 4: REPLICATE store ir<%25>, ir<%26>
+; CHECK:  Cost for VF 4: 115 (Estimated cost per lane: 29)
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%10> = load ir<%9>
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%12> = load ir<%11>
+; CHECK:  Cost of 24 for VF 8: REPLICATE store ir<%13>, ir<%14>
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%16> = load ir<%15>
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%18> = load ir<%17>
+; CHECK:  Cost of 24 for VF 8: REPLICATE store ir<%19>, ir<%20>
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%22> = load ir<%21>
+; CHECK:  Cost of 24 for VF 8: REPLICATE ir<%24> = load ir<%23>
+; CHECK:  Cost of 24 for VF 8: REPLICATE store ir<%25>, ir<%26>
+; CHECK:  Cost for VF 8: 223 (Estimated cost per lane: 28)
+; CHECK:  LV: Selecting VF: 1.
+;
   %5 = icmp eq i32 %3, 0
   br i1 %5, label %6, label %7
 
@@ -204,43 +251,59 @@ define hidden void @three_shorts(ptr noalias nocapture noundef writeonly %0, ptr
   br i1 %28, label %6, label %7
 }
 
-; CHECK-LABEL: four_shorts_same_op
-; CHECK: LV: Scalar loop costs: 20.
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 2: 62 (Estimated cost per lane: 31.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 4: 62 (Estimated cost per lane: 15.
-; CHECK: Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 8: 212 (Estimated cost per lane: 26.
-; CHECK: LV: Selecting VF: 4.
 define hidden void @four_shorts_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_shorts_same_op'
+; CHECK:  LV: Scalar loop costs: 20.
+; CHECK:  Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:    ir<%22> = load from index 2
+; CHECK:    ir<%28> = load from index 3
+; CHECK:  Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:    ir<%24> = load from index 2
+; CHECK:    ir<%30> = load from index 3
+; CHECK:  Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:    store ir<%25> to index 2
+; CHECK:    store ir<%31> to index 3
+; CHECK:  Cost for VF 2: 62 (Estimated cost per lane: 31)
+; CHECK:  Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:    ir<%22> = load from index 2
+; CHECK:    ir<%28> = load from index 3
+; CHECK:  Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:    ir<%24> = load from index 2
+; CHECK:    ir<%30> = load from index 3
+; CHECK:  Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:    store ir<%25> to index 2
+; CHECK:    store ir<%31> to index 3
+; CHECK:  Cost for VF 4: 62 (Estimated cost per lane: 16)
+; CHECK:  Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%9>
+; CHECK:    ir<%10> = load from index 0
+; CHECK:    ir<%16> = load from index 1
+; CHECK:    ir<%22> = load from index 2
+; CHECK:    ir<%28> = load from index 3
+; CHECK:  Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%11>
+; CHECK:    ir<%12> = load from index 0
+; CHECK:    ir<%18> = load from index 1
+; CHECK:    ir<%24> = load from index 2
+; CHECK:    ir<%30> = load from index 3
+; CHECK:  Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%14>
+; CHECK:    store ir<%13> to index 0
+; CHECK:    store ir<%19> to index 1
+; CHECK:    store ir<%25> to index 2
+; CHECK:    store ir<%31> to index 3
+; CHECK:  Cost for VF 8: 212 (Estimated cost per lane: 26)
+; CHECK:  LV: Selecting VF: 4.
+;
   %5 = icmp eq i32 %3, 0
   br i1 %5, label %6, label %7
 
@@ -282,43 +345,59 @@ define hidden void @four_shorts_same_op(ptr noalias nocapture noundef writeonly
   br i1 %34, label %6, label %7
 }
 
-; CHECK-LABEL: four_shorts_split_op
-; CHECK: LV: Scalar loop costs: 20.
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 2: 62 (Estimated cost per lane: 31.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 4: 62 (Estimated cost per lane: 15.
-; CHECK: Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%9>
-; CHECK-NEXT:   ir<%10> = load from index 0
-; CHECK-NEXT:   ir<%16> = load from index 1
-; CHECK-NEXT:   ir<%22> = load from index 2
-; CHECK-NEXT:   ir<%28> = load from index 3
-; CHECK: Cost of 68 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%14>
-; CHECK-NEXT:   store ir<%13> to index 0
-; CHECK-NEXT:   store ir<%19> to index 1
-; CHECK-NEXT:   store ir<%25> to index 2
-; CHECK-NEXT:   store ir<%31> to index 3
-; CHECK: Cost for VF 8: 212 (Estimated cost p...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list