[llvm] [LV][NFC] Use APFloat class when printing out costs per lane (PR #201824)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 05:15:31 PDT 2026
https://github.com/david-arm updated https://github.com/llvm/llvm-project/pull/201824
>From c68a4ce716a5441ae535198cf480085f90f8322f Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Tue, 9 Jun 2026 13:37:34 +0000
Subject: [PATCH 1/4] [LV][NFC] Use APFloat class when printing out costs per
lane
At the moment it's difficult to auto-generate CHECK lines for
cost model output because the floating point value printed
out along with "Estimated cost per lane" is fragile and can
vary from target to target. See PR #201580 for an example of
this. Also, I would like to start using auto-generation of
cost model CHECK lines more often in tests to make life
easier for developers to update them.
Following reviewer feedback, I've solved this by using the
APFloat class to create a deterministic and consistent way
of printing out a floating point value across all targets.
However, this also then leads to significant changes in many
tests, in particular there are a very large number of changes
in the WebAssembly/memory-interleave.ll file. Rather than
manually edit and change every single case I have opted for
auto-generation of cost CHECK lines instead. This requires
adding a new debug-only flag called
-vplan-print-metadata
which is true by default. This flag controls the printing
of recipe metadata, which has non-deterministic output.
When auto-generating CHECK lines we need to disable this.
---
.../Transforms/Vectorize/LoopVectorize.cpp | 10 +-
.../lib/Transforms/Vectorize/VPlanRecipes.cpp | 10 +-
.../force-scalable-vectorization-always.ll | 15 +-
.../scalable-vectorization-cost-tuning.ll | 40 +-
.../LoopVectorize/ARM/mve-icmpcost.ll | 671 ++--
.../ARM/mve-reg-pressure-spills.ll | 42 +-
.../WebAssembly/memory-interleave.ll | 3153 ++++++++++-------
7 files changed, 2362 insertions(+), 1579 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index f9b325a5233e6..90e4299d52e6b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5764,8 +5764,14 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
LLVM_DEBUG(dbgs() << "Cost for VF " << VF << ": " << Cost
<< " (Estimated cost per lane: ");
if (Cost.isValid()) {
- double CostPerLane = double(Cost.getValue()) / EstimatedWidth;
- LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
+ APFloat CostPerLane(APFloat::IEEEdouble(),
+ APInt(64, (uint64_t)Cost.getValue()));
+ APFloat EstimatedWidthAsAPFloat(APFloat::IEEEdouble(),
+ APInt(64, (uint64_t)EstimatedWidth));
+
+ (void)CostPerLane.divide(EstimatedWidthAsAPFloat,
+ APFloat::rmNearestTiesToEven);
+ LLVM_DEBUG(dbgs() << 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 9aeacd28e00cf..31b511c359a69 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -47,6 +47,14 @@ using VectorParts = SmallVector<Value *, 2>;
#define LV_NAME "loop-vectorize"
#define DEBUG_TYPE LV_NAME
+#if !defined(NDEBUG)
+// It is sometimes necessary to disable printing of metadata in tests in order
+// to avoid non-deterministic behaviour.
+static cl::opt<bool> VPlanPrintMetadata(
+ "vplan-print-metadata", cl::init(true), cl::Hidden,
+ cl::desc("Controls the printing of recipe metadata when debugging."));
+#endif
+
bool VPRecipeBase::mayWriteToMemory() const {
switch (getVPRecipeID()) {
case VPExpressionSC:
@@ -2022,7 +2030,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 || !VPlanPrintMetadata)
return;
ArrayRef<StringRef> MDNames = SlotTracker.getMDNames();
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 d3b1520cb8d25..9a9e55f2ec2d3 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/force-scalable-vectorization-always.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --filter "VPlan 'Final VPlan for VF" --version 6
; 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
@@ -7,12 +8,12 @@ target triple = "aarch64"
; but that a scalable VF is still chosen (due to the `-scalable-vectorization=always` flag)
define i32 @cost_prefers_fixed_width_vf_but_force_scalable_vf(ptr noalias %dst, ptr noalias %src, i64 %n) "target-cpu"="neoverse-n2" {
; CHECK-LABEL: 'cost_prefers_fixed_width_vf_but_force_scalable_vf'
-; CHECK: Cost for VF 2: 12 (Estimated cost per lane: 6.
-; CHECK: Cost for VF 4: 8 (Estimated cost per lane: 2.
-; CHECK: Cost for VF 8: 10 (Estimated cost per lane: 1.
+; CHECK: Cost for VF 2: 12 (Estimated cost per lane: 6)
+; CHECK: Cost for VF 4: 8 (Estimated cost per lane: 2)
+; CHECK: Cost for VF 8: 10 (Estimated cost per lane: 1.25)
; CHECK: Cost for VF vscale x 1: Invalid (Estimated cost per lane: Invalid)
-; CHECK: Cost for VF vscale x 2: 9 (Estimated cost per lane: 4.
-; CHECK: Cost for VF vscale x 4: 8 (Estimated cost per lane: 2.
+; CHECK: Cost for VF vscale x 2: 9 (Estimated cost per lane: 4.5)
+; CHECK: Cost for VF vscale x 4: 8 (Estimated cost per lane: 2)
; CHECK: LV: Selecting VF: vscale x 4.
; CHECK: VPlan 'Final VPlan for VF={vscale x 1,vscale x 2,vscale x 4},UF={2}' {
;
@@ -39,8 +40,8 @@ exit:
; if we can't vectorize with SVE (in this case, because SVE is unavailable)
define i32 @no_sve_fallback_to_neon(ptr %src, i64 %n) "target-features"="+neon" {
; CHECK-LABEL: 'no_sve_fallback_to_neon'
-; CHECK: Cost for VF 2: 4 (Estimated cost per lane: 2.
-; CHECK: Cost for VF 4: 4 (Estimated cost per lane: 1.
+; CHECK: Cost for VF 2: 4 (Estimated cost per lane: 2)
+; CHECK: Cost for VF 4: 4 (Estimated cost per lane: 1)
; CHECK: LV: Selecting VF: 4.
; CHECK: VPlan 'Final VPlan for VF={2,4},UF={2}' {
;
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 bc61d69b9ff29..86e560ee141fc 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF vscale" --filter "LV: Selecting VF" --version 6
; REQUIRES: asserts
; RUN: opt -mtriple=aarch64 -mattr=+sve \
; RUN: -force-target-instruction-cost=1 -passes=loop-vectorize -S -debug-only=loop-vectorize --disable-output < %s 2>&1 \
@@ -23,22 +24,31 @@
; 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-PREFER-FIXED
-; VSCALEFORTUNING1: Cost for VF vscale x 2: 10 (Estimated cost per lane: 5.
-; VSCALEFORTUNING1: Cost for VF vscale x 4: 10 (Estimated cost per lane: 2.
-; VSCALEFORTUNING1: LV: Selecting VF: vscale x 16
-
-; VSCALEFORTUNING2: Cost for VF vscale x 2: 10 (Estimated cost per lane: 2.
-; VSCALEFORTUNING2: Cost for VF vscale x 4: 10 (Estimated cost per lane: 1.
-; VSCALEFORTUNING2: LV: Selecting VF: vscale x 16
-
-; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 2: 10 (Estimated cost per lane: 5.
-; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 4: 10 (Estimated cost per lane: 2.
-; VSCALEFORTUNING1-PREFER-FIXED: LV: Selecting VF: 16
-
-; VSCALEFORTUNING1: <vscale x 16 x i8>
-; VSCALEFORTUNING2: <vscale x 16 x i8>
-; VSCALEFORTUNING1-PREFER-FIXED: <16 x i8>
define void @test0(ptr %a, ptr %b, ptr %c) #0 {
+; VSCALEFORTUNING1-LABEL: 'test0'
+; VSCALEFORTUNING1: Cost for VF vscale x 1: Invalid (Estimated cost per lane: Invalid)
+; VSCALEFORTUNING1: Cost for VF vscale x 2: 10 (Estimated cost per lane: 5)
+; VSCALEFORTUNING1: Cost for VF vscale x 4: 10 (Estimated cost per lane: 2.5)
+; VSCALEFORTUNING1: Cost for VF vscale x 8: 10 (Estimated cost per lane: 1.25)
+; VSCALEFORTUNING1: Cost for VF vscale x 16: 10 (Estimated cost per lane: 0.625)
+; VSCALEFORTUNING1: LV: Selecting VF: vscale x 16.
+;
+; VSCALEFORTUNING2-LABEL: 'test0'
+; VSCALEFORTUNING2: Cost for VF vscale x 1: Invalid (Estimated cost per lane: Invalid)
+; VSCALEFORTUNING2: Cost for VF vscale x 2: 10 (Estimated cost per lane: 2.5)
+; VSCALEFORTUNING2: Cost for VF vscale x 4: 10 (Estimated cost per lane: 1.25)
+; VSCALEFORTUNING2: Cost for VF vscale x 8: 10 (Estimated cost per lane: 0.625)
+; VSCALEFORTUNING2: Cost for VF vscale x 16: 10 (Estimated cost per lane: 0.3125)
+; VSCALEFORTUNING2: LV: Selecting VF: vscale x 16.
+;
+; VSCALEFORTUNING1-PREFER-FIXED-LABEL: 'test0'
+; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 1: Invalid (Estimated cost per lane: Invalid)
+; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 2: 10 (Estimated cost per lane: 5)
+; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 4: 10 (Estimated cost per lane: 2.5)
+; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 8: 10 (Estimated cost per lane: 1.25)
+; VSCALEFORTUNING1-PREFER-FIXED: Cost for VF vscale x 16: 10 (Estimated cost per lane: 0.625)
+; VSCALEFORTUNING1-PREFER-FIXED: LV: Selecting VF: 16.
+;
entry:
br label %loop
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
index 563d78812fcd9..e2c20107b14e9 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
@@ -1,71 +1,107 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --filter "Found an estimated cost of .* for VF 1" --filter "Cost of .* for VF" --version 6
; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s
; REQUIRES: asserts
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv8.1m.main-arm-none-eabi"
-; CHECK-LABEL: LV: Checking a loop in 'expensive_icmp'
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %arrayidx = getelementptr inbounds i16, ptr %s, i32 %i.016
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %1 = load i16, ptr %arrayidx, align 2
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv = sext i16 %1 to i32
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp2 = icmp sgt i32 %conv, %conv1
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %cmp2, label %if.then, label %for.inc
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %conv6 = add i16 %1, %0
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %arrayidx7 = getelementptr inbounds i16, ptr %d, i32 %i.016
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %conv6, ptr %arrayidx7, align 2
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br label %for.inc
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %inc = add nuw nsw i32 %i.016, 1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %exitcond.not = icmp eq i32 %inc, %n
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body
-; CHECK: LV: Scalar loop costs: 5.
-; CHECK: Cost of 1 for VF 2: induction instruction %inc = add nuw nsw i32 %i.016, 1
-; CHECK: Cost of 0 for VF 2: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
-; CHECK: Cost of 0 for VF 2: vp<{{.+}}> = SCALAR-STEPS vp<{{.+}}>, ir<1>
-; CHECK: Cost of 0 for VF 2: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 2: vp<{{.+}}> = vector-pointer inbounds ir<%arrayidx>
-; CHECK: Cost of 18 for VF 2: WIDEN ir<%1> = load vp<{{.+}}>
-; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
-; CHECK: Cost of 20 for VF 2: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
-; CHECK: Cost of 26 for VF 2: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
-; CHECK: Cost of 0 for VF 2: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 2: vp<{{.+}}> = vector-pointer ir<%arrayidx7>
-; CHECK: Cost of 16 for VF 2: WIDEN store vp<{{.+}}>, ir<%conv6>, ir<%cmp2>
-; CHECK: Cost of 0 for VF 2: EMIT vp<%index.next> = add nuw vp<{{.+}}>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 2: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 2: 86 (Estimated cost per lane: 43.
-; CHECK: Cost of 1 for VF 4: induction instruction %inc = add nuw nsw i32 %i.016, 1
-; CHECK: Cost of 0 for VF 4: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
-; CHECK: Cost of 0 for VF 4: vp<{{.+}}> = SCALAR-STEPS vp<{{.+}}>, ir<1>
-; CHECK: Cost of 0 for VF 4: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 4: vp<{{.+}}> = vector-pointer inbounds ir<%arrayidx>
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%1> = load vp<{{.+}}>
-; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
-; CHECK: Cost of 0 for VF 4: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 4: vp<{{.+}}> = vector-pointer ir<%arrayidx7>
-; CHECK: Cost of 2 for VF 4: WIDEN store vp<{{.+}}>, ir<%conv6>, ir<%cmp2>
-; CHECK: Cost of 0 for VF 4: EMIT vp<%index.next> = add nuw vp<{{.+}}>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 4: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 4: 10 (Estimated cost per lane: 2.
-; CHECK: Cost of 1 for VF 8: induction instruction %inc = add nuw nsw i32 %i.016, 1
-; CHECK: Cost of 0 for VF 8: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
-; CHECK: Cost of 0 for VF 8: vp<{{.+}}> = SCALAR-STEPS vp<{{.+}}>, ir<1>
-; CHECK: Cost of 0 for VF 8: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 8: vp<{{.+}}> = vector-pointer inbounds ir<%arrayidx>
-; CHECK: Cost of 2 for VF 8: WIDEN ir<%1> = load vp<{{.+}}>
-; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
-; CHECK: Cost of 36 for VF 8: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
-; CHECK: Cost of 2 for VF 8: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
-; CHECK: Cost of 0 for VF 8: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<{{.+}}>
-; CHECK: Cost of 0 for VF 8: vp<{{.+}}> = vector-pointer ir<%arrayidx7>
-; CHECK: Cost of 2 for VF 8: WIDEN store vp<{{.+}}>, ir<%conv6>, ir<%cmp2>
-; CHECK: Cost of 0 for VF 8: EMIT vp<%index.next> = add nuw vp<{{.+}}>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 8: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 8: 46 (Estimated cost per lane: 5.
-; CHECK: LV: Selecting VF: 4.
define void @expensive_icmp(ptr noalias nocapture %d, ptr nocapture readonly %s, i32 %n, i16 zeroext %m) #0 {
+; CHECK-LABEL: 'expensive_icmp'
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %arrayidx = getelementptr inbounds i16, ptr %s, i32 %i.016
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %1 = load i16, ptr %arrayidx, align 2
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv = sext i16 %1 to i32
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp2 = icmp sgt i32 %conv, %conv1
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %cmp2, label %if.then, label %for.inc
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %conv6 = add i16 %1, %0
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %arrayidx7 = getelementptr inbounds i16, ptr %d, i32 %i.016
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i16 %conv6, ptr %arrayidx7, align 2
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br label %for.inc
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %inc = add nuw nsw i32 %i.016, 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %exitcond.not = icmp eq i32 %inc, %n
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body
+; CHECK: Cost of 1 for VF 2: induction instruction %inc = add nuw nsw i32 %i.016, 1
+; CHECK: Cost of 0 for VF 2: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
+; CHECK: Cost of 0 for VF 2: vp<[[VP4:%[0-9]+]]> = SCALAR-STEPS vp<[[VP3:%[0-9]+]]>, ir<1>, vp<[[VP0:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP5:%[0-9]+]]> = vector-pointer inbounds ir<%arrayidx>, ir<1>
+; CHECK: Cost of 18 for VF 2: WIDEN ir<%1> = load vp<[[VP5]]>
+; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
+; CHECK: Cost of 20 for VF 2: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
+; CHECK: Cost of 26 for VF 2: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
+; CHECK: Cost of 0 for VF 2: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP6:%[0-9]+]]> = vector-pointer ir<%arrayidx7>, ir<1>
+; CHECK: Cost of 16 for VF 2: WIDEN store vp<[[VP6]]>, ir<%conv6>, ir<%cmp2>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1:%[0-9]+]]>
+; CHECK: Cost of 1 for VF 2: EMIT branch-on-count vp<%index.next>, vp<[[VP2:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: vector loop backedge
+; CHECK: Cost of 0 for VF 2: IR %conv1 = zext i16 %m to i32
+; CHECK: Cost of 0 for VF 2: IR %0 = trunc i32 %n to i16
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP2]]>, middle.block ], [ ir<0>, ir-bb<for.body.lr.ph> ]
+; CHECK: Cost of 0 for VF 2: IR %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %arrayidx = getelementptr inbounds i16, ptr %s, i32 %i.016
+; CHECK: Cost of 0 for VF 2: IR %1 = load i16, ptr %arrayidx, align 2
+; CHECK: Cost of 0 for VF 2: IR %conv = sext i16 %1 to i32
+; CHECK: Cost of 0 for VF 2: IR %cmp2 = icmp sgt i32 %conv, %conv1
+; CHECK: Cost of 1 for VF 2: EMIT vp<%cmp.n> = icmp eq ir<%n>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 2: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 2: 86 (Estimated cost per lane: 43)
+; CHECK: Cost of 1 for VF 4: induction instruction %inc = add nuw nsw i32 %i.016, 1
+; CHECK: Cost of 0 for VF 4: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
+; CHECK: Cost of 0 for VF 4: vp<[[VP4]]> = SCALAR-STEPS vp<[[VP3]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP5]]> = vector-pointer inbounds ir<%arrayidx>, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%1> = load vp<[[VP5]]>
+; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
+; CHECK: Cost of 0 for VF 4: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP6]]> = vector-pointer ir<%arrayidx7>, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN store vp<[[VP6]]>, ir<%conv6>, ir<%cmp2>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 4: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: vector loop backedge
+; CHECK: Cost of 0 for VF 4: IR %conv1 = zext i16 %m to i32
+; CHECK: Cost of 0 for VF 4: IR %0 = trunc i32 %n to i16
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP2]]>, middle.block ], [ ir<0>, ir-bb<for.body.lr.ph> ]
+; CHECK: Cost of 0 for VF 4: IR %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %arrayidx = getelementptr inbounds i16, ptr %s, i32 %i.016
+; CHECK: Cost of 0 for VF 4: IR %1 = load i16, ptr %arrayidx, align 2
+; CHECK: Cost of 0 for VF 4: IR %conv = sext i16 %1 to i32
+; CHECK: Cost of 0 for VF 4: IR %cmp2 = icmp sgt i32 %conv, %conv1
+; CHECK: Cost of 1 for VF 4: EMIT vp<%cmp.n> = icmp eq ir<%n>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 4: 10 (Estimated cost per lane: 2.5)
+; CHECK: Cost of 1 for VF 8: induction instruction %inc = add nuw nsw i32 %i.016, 1
+; CHECK: Cost of 0 for VF 8: induction instruction %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
+; CHECK: Cost of 0 for VF 8: vp<[[VP4]]> = SCALAR-STEPS vp<[[VP3]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 8: CLONE ir<%arrayidx> = getelementptr inbounds ir<%s>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 8: vp<[[VP5]]> = vector-pointer inbounds ir<%arrayidx>, ir<1>
+; CHECK: Cost of 2 for VF 8: WIDEN ir<%1> = load vp<[[VP5]]>
+; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv> = sext ir<%1> to i32
+; CHECK: Cost of 36 for VF 8: WIDEN ir<%cmp2> = icmp sgt ir<%conv>, ir<%conv1>
+; CHECK: Cost of 2 for VF 8: WIDEN ir<%conv6> = add ir<%1>, ir<%0>
+; CHECK: Cost of 0 for VF 8: CLONE ir<%arrayidx7> = getelementptr ir<%d>, vp<[[VP4]]>
+; CHECK: Cost of 0 for VF 8: vp<[[VP6]]> = vector-pointer ir<%arrayidx7>, ir<1>
+; CHECK: Cost of 2 for VF 8: WIDEN store vp<[[VP6]]>, ir<%conv6>, ir<%cmp2>
+; CHECK: Cost of 0 for VF 8: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 8: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 8: vector loop backedge
+; CHECK: Cost of 0 for VF 8: IR %conv1 = zext i16 %m to i32
+; CHECK: Cost of 0 for VF 8: IR %0 = trunc i32 %n to i16
+; CHECK: Cost of 0 for VF 8: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP2]]>, middle.block ], [ ir<0>, ir-bb<for.body.lr.ph> ]
+; CHECK: Cost of 0 for VF 8: IR %i.016 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 8: IR %arrayidx = getelementptr inbounds i16, ptr %s, i32 %i.016
+; CHECK: Cost of 0 for VF 8: IR %1 = load i16, ptr %arrayidx, align 2
+; CHECK: Cost of 0 for VF 8: IR %conv = sext i16 %1 to i32
+; CHECK: Cost of 0 for VF 8: IR %cmp2 = icmp sgt i32 %conv, %conv1
+; CHECK: Cost of 1 for VF 8: EMIT vp<%cmp.n> = icmp eq ir<%n>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 8: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 8: 46 (Estimated cost per lane: 5.75)
+; CHECK: LV: Selecting VF: 4.
+; CHECK: Cost of 1 for VF 4: EMIT vp<%cmp.n> = icmp eq ir<%n>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: EMIT branch-on-cond vp<%cmp.n>
+;
entry:
%cmp15 = icmp sgt i32 %n, 0
br i1 %cmp15, label %for.body.lr.ph, label %for.cond.cleanup
@@ -98,150 +134,272 @@ for.inc:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: LV: Checking a loop in 'cheap_icmp'
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %0 = load i8, ptr %pSrcA.addr.011, align 1
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv1 = sext i8 %0 to i32
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %1 = load i8, ptr %pSrcB.addr.09, align 1
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv3 = sext i8 %1 to i32
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %mul = mul nsw i32 %conv3, %conv1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %shr = ashr i32 %mul, 7
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %2 = icmp slt i32 %shr, 127
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %spec.select.i = select i1 %2, i32 %shr, i32 127
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv4 = trunc i32 %spec.select.i to i8
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i8 %conv4, ptr %pDst.addr.010, align 1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %dec = add i32 %blkCnt.012, -1
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp.not = icmp eq i32 %dec, 0
-; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %cmp.not, label %while.end.loopexit, label %while.body
-; CHECK: LV: Scalar loop costs: 9.
-; CHECK: Cost of 1 for VF 2: induction instruction %dec = add i32 %blkCnt.012, -1
-; CHECK: Cost of 0 for VF 2: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
-; CHECK: Cost of 0 for VF 2: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
-; CHECK: Cost of 0 for VF 2: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
-; CHECK: Cost of 0 for VF 2: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 2: vp<[[STEPS1:%.+]]> = SCALAR-STEPS vp<[[CAN_IV:%.+]]>, ir<1>
-; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[STEPS1]]>
-; CHECK: Cost of 0 for VF 2: vp<[[STEPS2:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[STEPS2]]>
-; CHECK: Cost of 0 for VF 2: vp<[[STEPS3:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[STEPS3]]>
-; CHECK: Cost of 0 for VF 2: vp<[[VEC_PTR:%.+]]> = vector-pointer vp<%next.gep>
-; CHECK: Cost of 18 for VF 2: WIDEN ir<%0> = load vp<[[VEC_PTR]]>
-; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
-; CHECK: Cost of 0 for VF 2: vp<[[VEC_PTR2:%.+]]> = vector-pointer vp<%next.gep>.2
-; CHECK: Cost of 18 for VF 2: WIDEN ir<%1> = load vp<[[VEC_PTR2]]>
-; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
-; CHECK: Cost of 26 for VF 2: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
-; CHECK: Cost of 18 for VF 2: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
-; CHECK: Cost of 0 for VF 2: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
-; CHECK: Cost of 22 for VF 2: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
-; CHECK: Cost of 0 for VF 2: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
-; CHECK: Cost of 0 for VF 2: vp<[[VEC_PTR3:%.+]]> = vector-pointer vp<%next.gep>.1
-; CHECK: Cost of 18 for VF 2: WIDEN store vp<[[VEC_PTR3]]>, ir<%conv4>
-; CHECK: Cost of 0 for VF 2: EMIT vp<%index.next> = add nuw vp<[[CAN_IV]]>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 2: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 2: 130 (Estimated cost per lane: 65.
-; CHECK: Cost of 1 for VF 4: induction instruction %dec = add i32 %blkCnt.012, -1
-; CHECK: Cost of 0 for VF 4: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
-; CHECK: Cost of 0 for VF 4: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
-; CHECK: Cost of 0 for VF 4: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
-; CHECK: Cost of 0 for VF 4: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 4: vp<[[STEPS1:%.+]]> = SCALAR-STEPS vp<[[CAN_IV:%.+]]>, ir<1>
-; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[STEPS1]]>
-; CHECK: Cost of 0 for VF 4: vp<[[STEPS2:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[STEPS2]]>
-; CHECK: Cost of 0 for VF 4: vp<[[STEPS3:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[STEPS3]]>
-; CHECK: Cost of 0 for VF 4: vp<[[VEC_PTR1:%.+]]> = vector-pointer vp<%next.gep>
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%0> = load vp<[[VEC_PTR1]]>
-; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
-; CHECK: Cost of 0 for VF 4: vp<[[VEC_PTR2:%.+]]> = vector-pointer vp<%next.gep>.2
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%1> = load vp<[[VEC_PTR2]]>
-; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
-; CHECK: Cost of 0 for VF 4: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
-; CHECK: Cost of 2 for VF 4: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
-; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
-; CHECK: Cost of 0 for VF 4: vp<[[VEC_PTR2:%.+]]> = vector-pointer vp<%next.gep>.1
-; CHECK: Cost of 2 for VF 4: WIDEN store vp<[[VEC_PTR2]]>, ir<%conv4>
-; CHECK: Cost of 0 for VF 4: EMIT vp<%index.next> = add nuw vp<[[CAN_IV]]>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 4: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 4: 14 (Estimated cost per lane: 3.
-; CHECK: Cost of 1 for VF 8: induction instruction %dec = add i32 %blkCnt.012, -1
-; CHECK: Cost of 0 for VF 8: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
-; CHECK: Cost of 0 for VF 8: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
-; CHECK: Cost of 0 for VF 8: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
-; CHECK: Cost of 0 for VF 8: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 8: vp<[[STEPS1:%.+]]> = SCALAR-STEPS vp<[[CAN_IV:%.+]]>, ir<1>
-; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[STEPS1]]>
-; CHECK: Cost of 0 for VF 8: vp<[[STEPS2:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[STEPS2]]>
-; CHECK: Cost of 0 for VF 8: vp<[[STEPS3:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[STEPS3]]>
-; CHECK: Cost of 0 for VF 8: vp<[[VEC_PTR1:%.+]]> = vector-pointer vp<%next.gep>
-; CHECK: Cost of 2 for VF 8: WIDEN ir<%0> = load vp<[[VEC_PTR1]]>
-; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
-; CHECK: Cost of 0 for VF 8: vp<[[VEC_PTR2:%.+]]> = vector-pointer vp<%next.gep>.2
-; CHECK: Cost of 2 for VF 8: WIDEN ir<%1> = load vp<[[VEC_PTR2]]>
-; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
-; CHECK: Cost of 4 for VF 8: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
-; CHECK: Cost of 4 for VF 8: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
-; CHECK: Cost of 0 for VF 8: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
-; CHECK: Cost of 4 for VF 8: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
-; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
-; CHECK: Cost of 0 for VF 8: vp<[[VEC_PTR3:%.+]]> = vector-pointer vp<%next.gep>.1
-; CHECK: Cost of 2 for VF 8: WIDEN store vp<[[VEC_PTR3]]>, ir<%conv4>
-; CHECK: Cost of 0 for VF 8: EMIT vp<%index.next> = add nuw vp<[[CAN_IV]]>, vp<{{.+}}
-; CHECK: Cost of 1 for VF 8: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 8: 26 (Estimated cost per lane: 3.
-; CHECK: Cost of 1 for VF 16: induction instruction %dec = add i32 %blkCnt.012, -1
-; CHECK: Cost of 0 for VF 16: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
-; CHECK: Cost of 0 for VF 16: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
-; CHECK: Cost of 0 for VF 16: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
-; CHECK: Cost of 0 for VF 16: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
-; CHECK: Cost of 0 for VF 16: vp<[[STEPS1:%.+]]> = SCALAR-STEPS vp<[[CAN_IV:%.+]]>, ir<1>
-; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[STEPS1]]>
-; CHECK: Cost of 0 for VF 16: vp<[[STEPS2:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[STEPS2]]>
-; CHECK: Cost of 0 for VF 16: vp<[[STEPS3:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
-; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[STEPS3]]>
-; CHECK: Cost of 0 for VF 16: vp<[[VEC_PTR:%.+]]> = vector-pointer vp<%next.gep>
-; CHECK: Cost of 2 for VF 16: WIDEN ir<%0> = load vp<[[VEC_PTR]]>
-; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
-; CHECK: Cost of 0 for VF 16: vp<[[VEC_PTR1:%.+]]> = vector-pointer vp<%next.gep>.2
-; CHECK: Cost of 2 for VF 16: WIDEN ir<%1> = load vp<[[VEC_PTR1]]>
-; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
-; CHECK: Cost of 8 for VF 16: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
-; CHECK: Cost of 8 for VF 16: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
-; CHECK: Cost of 0 for VF 16: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
-; CHECK: Cost of 8 for VF 16: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
-; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
-; CHECK: Cost of 0 for VF 16: vp<[[VEC_PTR2:%.+]]> = vector-pointer vp<%next.gep>.1
-; CHECK: Cost of 2 for VF 16: WIDEN store vp<[[VEC_PTR2]]>, ir<%conv4>
-; CHECK: Cost of 0 for VF 16: EMIT vp<%index.next> = add nuw vp<[[CAN_IV]]>, vp<{{.+}}>
-; CHECK: Cost of 1 for VF 16: EMIT branch-on-count vp<%index.next>, vp<{{.+}}>
-; CHECK: Cost for VF 16: 50
-; CHECK: LV: Selecting VF: 16.
define void @cheap_icmp(ptr nocapture readonly %pSrcA, ptr nocapture readonly %pSrcB, ptr nocapture %pDst, i32 %blockSize) #0 {
+; CHECK-LABEL: 'cheap_icmp'
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %0 = load i8, ptr %pSrcA.addr.011, align 1
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv1 = sext i8 %0 to i32
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %1 = load i8, ptr %pSrcB.addr.09, align 1
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv3 = sext i8 %1 to i32
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %mul = mul nsw i32 %conv3, %conv1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %shr = ashr i32 %mul, 7
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %2 = icmp slt i32 %shr, 127
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %spec.select.i = select i1 %2, i32 %shr, i32 127
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %conv4 = trunc i32 %spec.select.i to i8
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i8 %conv4, ptr %pDst.addr.010, align 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %dec = add i32 %blkCnt.012, -1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp.not = icmp eq i32 %dec, 0
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %cmp.not, label %while.end.loopexit, label %while.body
+; CHECK: Cost of 1 for VF 2: induction instruction %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 2: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 2: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 2: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 2: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 2: vp<[[VP8:%[0-9]+]]> = SCALAR-STEPS vp<[[VP7:%[0-9]+]]>, ir<1>, vp<[[VP0:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[VP8]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP9:%[0-9]+]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP9]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP10:%[0-9]+]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP11:%[0-9]+]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 18 for VF 2: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
+; CHECK: Cost of 0 for VF 2: vp<[[VP12:%[0-9]+]]> = vector-pointer vp<%next.gep>.2, ir<1>
+; CHECK: Cost of 18 for VF 2: WIDEN ir<%1> = load vp<[[VP12]]>
+; CHECK: Cost of 4 for VF 2: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
+; CHECK: Cost of 26 for VF 2: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
+; CHECK: Cost of 18 for VF 2: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
+; CHECK: Cost of 0 for VF 2: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
+; CHECK: Cost of 22 for VF 2: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
+; CHECK: Cost of 0 for VF 2: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
+; CHECK: Cost of 0 for VF 2: vp<[[VP13:%[0-9]+]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 18 for VF 2: WIDEN store vp<[[VP13]]>, ir<%conv4>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%index.next> = add nuw vp<[[VP7]]>, vp<[[VP1:%[0-9]+]]>
+; CHECK: Cost of 1 for VF 2: EMIT branch-on-count vp<%index.next>, vp<[[VP2:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: vector loop backedge
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3:%[0-9]+]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4:%[0-9]+]]>, middle.block ], [ ir<%pSrcA>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5:%[0-9]+]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val>.3 = phi [ vp<[[VP6:%[0-9]+]]>, middle.block ], [ ir<%pSrcB>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: IR %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.3 from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 2: IR %0 = load i8, ptr %pSrcA.addr.011, align 1
+; CHECK: Cost of 0 for VF 2: IR %conv1 = sext i8 %0 to i32
+; CHECK: Cost of 0 for VF 2: IR %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 2: IR %1 = load i8, ptr %pSrcB.addr.09, align 1
+; CHECK: Cost of 0 for VF 2: IR %conv3 = sext i8 %1 to i32
+; CHECK: Cost of 0 for VF 2: IR %mul = mul nsw i32 %conv3, %conv1
+; CHECK: Cost of 0 for VF 2: IR %shr = ashr i32 %mul, 7
+; CHECK: Cost of 0 for VF 2: IR %2 = icmp slt i32 %shr, 127
+; CHECK: Cost of 0 for VF 2: IR %spec.select.i = select i1 %2, i32 %shr, i32 127
+; CHECK: Cost of 0 for VF 2: IR %conv4 = trunc i32 %spec.select.i to i8
+; CHECK: Cost of 0 for VF 2: IR %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 2: IR store i8 %conv4, ptr %pDst.addr.010, align 1
+; CHECK: Cost of 0 for VF 2: IR %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 2: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 1 for VF 2: vp<[[VP3]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 2: vp<[[VP4]]> = DERIVED-IV ir<%pSrcA> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 2: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 2: vp<[[VP6]]> = DERIVED-IV ir<%pSrcB> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 1 for VF 2: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 2: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 2: 130 (Estimated cost per lane: 65)
+; CHECK: Cost of 1 for VF 4: induction instruction %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 4: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 4: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 4: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 4: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 4: vp<[[VP8]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[VP8]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP9]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP9]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP10]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP11]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
+; CHECK: Cost of 0 for VF 4: vp<[[VP12]]> = vector-pointer vp<%next.gep>.2, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%1> = load vp<[[VP12]]>
+; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
+; CHECK: Cost of 0 for VF 4: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
+; CHECK: Cost of 0 for VF 4: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
+; CHECK: Cost of 0 for VF 4: vp<[[VP13]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN store vp<[[VP13]]>, ir<%conv4>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%index.next> = add nuw vp<[[VP7]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 4: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: vector loop backedge
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4]]>, middle.block ], [ ir<%pSrcA>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val>.3 = phi [ vp<[[VP6]]>, middle.block ], [ ir<%pSrcB>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: IR %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.3 from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 4: IR %0 = load i8, ptr %pSrcA.addr.011, align 1
+; CHECK: Cost of 0 for VF 4: IR %conv1 = sext i8 %0 to i32
+; CHECK: Cost of 0 for VF 4: IR %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 4: IR %1 = load i8, ptr %pSrcB.addr.09, align 1
+; CHECK: Cost of 0 for VF 4: IR %conv3 = sext i8 %1 to i32
+; CHECK: Cost of 0 for VF 4: IR %mul = mul nsw i32 %conv3, %conv1
+; CHECK: Cost of 0 for VF 4: IR %shr = ashr i32 %mul, 7
+; CHECK: Cost of 0 for VF 4: IR %2 = icmp slt i32 %shr, 127
+; CHECK: Cost of 0 for VF 4: IR %spec.select.i = select i1 %2, i32 %shr, i32 127
+; CHECK: Cost of 0 for VF 4: IR %conv4 = trunc i32 %spec.select.i to i8
+; CHECK: Cost of 0 for VF 4: IR %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 4: IR store i8 %conv4, ptr %pDst.addr.010, align 1
+; CHECK: Cost of 0 for VF 4: IR %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 4: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 1 for VF 4: vp<[[VP3]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 4: vp<[[VP4]]> = DERIVED-IV ir<%pSrcA> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 4: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 4: vp<[[VP6]]> = DERIVED-IV ir<%pSrcB> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 1 for VF 4: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 4: 14 (Estimated cost per lane: 3.5)
+; CHECK: Cost of 1 for VF 8: induction instruction %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 8: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 8: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 8: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 8: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 8: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 8: vp<[[VP8]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[VP8]]>
+; CHECK: Cost of 0 for VF 8: vp<[[VP9]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP9]]>
+; CHECK: Cost of 0 for VF 8: vp<[[VP10]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 8: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 8: vp<[[VP11]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 2 for VF 8: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
+; CHECK: Cost of 0 for VF 8: vp<[[VP12]]> = vector-pointer vp<%next.gep>.2, ir<1>
+; CHECK: Cost of 2 for VF 8: WIDEN ir<%1> = load vp<[[VP12]]>
+; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
+; CHECK: Cost of 4 for VF 8: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
+; CHECK: Cost of 4 for VF 8: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
+; CHECK: Cost of 0 for VF 8: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
+; CHECK: Cost of 4 for VF 8: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
+; CHECK: Cost of 2 for VF 8: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
+; CHECK: Cost of 0 for VF 8: vp<[[VP13]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 2 for VF 8: WIDEN store vp<[[VP13]]>, ir<%conv4>
+; CHECK: Cost of 0 for VF 8: EMIT vp<%index.next> = add nuw vp<[[VP7]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 8: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 8: vector loop backedge
+; CHECK: Cost of 0 for VF 8: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 8: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4]]>, middle.block ], [ ir<%pSrcA>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 8: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 8: EMIT-SCALAR vp<%bc.resume.val>.3 = phi [ vp<[[VP6]]>, middle.block ], [ ir<%pSrcB>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 8: IR %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 8: IR %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 8: IR %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 8: IR %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.3 from scalar.ph)
+; CHECK: Cost of 0 for VF 8: IR %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 8: IR %0 = load i8, ptr %pSrcA.addr.011, align 1
+; CHECK: Cost of 0 for VF 8: IR %conv1 = sext i8 %0 to i32
+; CHECK: Cost of 0 for VF 8: IR %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 8: IR %1 = load i8, ptr %pSrcB.addr.09, align 1
+; CHECK: Cost of 0 for VF 8: IR %conv3 = sext i8 %1 to i32
+; CHECK: Cost of 0 for VF 8: IR %mul = mul nsw i32 %conv3, %conv1
+; CHECK: Cost of 0 for VF 8: IR %shr = ashr i32 %mul, 7
+; CHECK: Cost of 0 for VF 8: IR %2 = icmp slt i32 %shr, 127
+; CHECK: Cost of 0 for VF 8: IR %spec.select.i = select i1 %2, i32 %shr, i32 127
+; CHECK: Cost of 0 for VF 8: IR %conv4 = trunc i32 %spec.select.i to i8
+; CHECK: Cost of 0 for VF 8: IR %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 8: IR store i8 %conv4, ptr %pDst.addr.010, align 1
+; CHECK: Cost of 0 for VF 8: IR %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 8: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 1 for VF 8: vp<[[VP3]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 8: vp<[[VP4]]> = DERIVED-IV ir<%pSrcA> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 8: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 8: vp<[[VP6]]> = DERIVED-IV ir<%pSrcB> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 1 for VF 8: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 8: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 8: 26 (Estimated cost per lane: 3.25)
+; CHECK: Cost of 1 for VF 16: induction instruction %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 16: induction instruction %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 16: induction instruction %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 16: induction instruction %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 16: induction instruction %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 16: induction instruction %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 16: vp<[[VP8]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep> = ptradd ir<%pSrcA>, vp<[[VP8]]>
+; CHECK: Cost of 0 for VF 16: vp<[[VP9]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP9]]>
+; CHECK: Cost of 0 for VF 16: vp<[[VP10]]> = SCALAR-STEPS vp<[[VP7]]>, ir<1>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 16: EMIT vp<%next.gep>.2 = ptradd ir<%pSrcB>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 16: vp<[[VP11]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 2 for VF 16: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv1> = sext ir<%0> to i32
+; CHECK: Cost of 0 for VF 16: vp<[[VP12]]> = vector-pointer vp<%next.gep>.2, ir<1>
+; CHECK: Cost of 2 for VF 16: WIDEN ir<%1> = load vp<[[VP12]]>
+; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv3> = sext ir<%1> to i32
+; CHECK: Cost of 8 for VF 16: WIDEN ir<%mul> = mul nsw ir<%conv3>, ir<%conv1>
+; CHECK: Cost of 8 for VF 16: WIDEN ir<%shr> = ashr ir<%mul>, ir<7>
+; CHECK: Cost of 0 for VF 16: WIDEN ir<%2> = icmp slt ir<%shr>, ir<127>
+; CHECK: Cost of 8 for VF 16: WIDEN ir<%spec.select.i> = select ir<%2>, ir<%shr>, ir<127>
+; CHECK: Cost of 6 for VF 16: WIDEN-CAST ir<%conv4> = trunc ir<%spec.select.i> to i8
+; CHECK: Cost of 0 for VF 16: vp<[[VP13]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 2 for VF 16: WIDEN store vp<[[VP13]]>, ir<%conv4>
+; CHECK: Cost of 0 for VF 16: EMIT vp<%index.next> = add nuw vp<[[VP7]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 16: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 16: vector loop backedge
+; CHECK: Cost of 0 for VF 16: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 16: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4]]>, middle.block ], [ ir<%pSrcA>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 16: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 16: EMIT-SCALAR vp<%bc.resume.val>.3 = phi [ vp<[[VP6]]>, middle.block ], [ ir<%pSrcB>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 16: IR %blkCnt.012 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 16: IR %pSrcA.addr.011 = phi ptr [ %incdec.ptr, %while.body ], [ %pSrcA, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 16: IR %pDst.addr.010 = phi ptr [ %incdec.ptr5, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 16: IR %pSrcB.addr.09 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrcB, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.3 from scalar.ph)
+; CHECK: Cost of 0 for VF 16: IR %incdec.ptr = getelementptr inbounds i8, ptr %pSrcA.addr.011, i32 1
+; CHECK: Cost of 0 for VF 16: IR %0 = load i8, ptr %pSrcA.addr.011, align 1
+; CHECK: Cost of 0 for VF 16: IR %conv1 = sext i8 %0 to i32
+; CHECK: Cost of 0 for VF 16: IR %incdec.ptr2 = getelementptr inbounds i8, ptr %pSrcB.addr.09, i32 1
+; CHECK: Cost of 0 for VF 16: IR %1 = load i8, ptr %pSrcB.addr.09, align 1
+; CHECK: Cost of 0 for VF 16: IR %conv3 = sext i8 %1 to i32
+; CHECK: Cost of 0 for VF 16: IR %mul = mul nsw i32 %conv3, %conv1
+; CHECK: Cost of 0 for VF 16: IR %shr = ashr i32 %mul, 7
+; CHECK: Cost of 0 for VF 16: IR %2 = icmp slt i32 %shr, 127
+; CHECK: Cost of 0 for VF 16: IR %spec.select.i = select i1 %2, i32 %shr, i32 127
+; CHECK: Cost of 0 for VF 16: IR %conv4 = trunc i32 %spec.select.i to i8
+; CHECK: Cost of 0 for VF 16: IR %incdec.ptr5 = getelementptr inbounds i8, ptr %pDst.addr.010, i32 1
+; CHECK: Cost of 0 for VF 16: IR store i8 %conv4, ptr %pDst.addr.010, align 1
+; CHECK: Cost of 0 for VF 16: IR %dec = add i32 %blkCnt.012, -1
+; CHECK: Cost of 0 for VF 16: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 1 for VF 16: vp<[[VP3]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 16: vp<[[VP4]]> = DERIVED-IV ir<%pSrcA> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 16: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 0 for VF 16: vp<[[VP6]]> = DERIVED-IV ir<%pSrcB> + vp<[[VP2]]> * ir<1>
+; CHECK: Cost of 1 for VF 16: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 16: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 16: 50 (Estimated cost per lane: 3.125)
+; CHECK: LV: Selecting VF: 16.
+; CHECK: Cost of 1 for VF 16: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 16: EMIT branch-on-cond vp<%cmp.n>
+;
entry:
%cmp.not8 = icmp eq i32 %blockSize, 0
br i1 %cmp.not8, label %while.end, label %while.body.preheader
@@ -278,10 +436,109 @@ while.end:
ret void
}
-; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp1 = fcmp
-; CHECK: Cost of 12 for VF 2: WIDEN ir<%cmp1> = fcmp olt nnan ninf nsz ir<%0>, ir<0.000000e+00>
-; CHECK: Cost of 24 for VF 4: WIDEN ir<%cmp1> = fcmp olt nnan ninf nsz ir<%0>, ir<0.000000e+00>
define void @floatcmp(ptr nocapture readonly %pSrc, ptr nocapture %pDst, i32 %blockSize) #0 {
+; CHECK-LABEL: 'floatcmp'
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pSrc.addr.010 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrc, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %blockSize.addr.09 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %pDst.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %0 = load float, ptr %pSrc.addr.010, align 4
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp1 = fcmp nnan ninf nsz olt float %0, 0.000000e+00
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cond = select nnan ninf nsz i1 %cmp1, float 1.000000e+01, float %0
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %conv = fptosi float %cond to i32
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr = getelementptr inbounds i32, ptr %pDst.addr.08, i32 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: store i32 %conv, ptr %pDst.addr.08, align 4
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: %incdec.ptr2 = getelementptr inbounds float, ptr %pSrc.addr.010, i32 1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %dec = add i32 %blockSize.addr.09, -1
+; CHECK: LV: Found an estimated cost of 1 for VF 1 For instruction: %cmp.not = icmp eq i32 %dec, 0
+; CHECK: LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %cmp.not, label %while.end.loopexit, label %while.body
+; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr2 = getelementptr inbounds float, ptr %pSrc.addr.010, i32 1
+; CHECK: Cost of 0 for VF 2: induction instruction %pSrc.addr.010 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrc, %while.body.preheader ]
+; CHECK: Cost of 1 for VF 2: induction instruction %dec = add i32 %blockSize.addr.09, -1
+; CHECK: Cost of 0 for VF 2: induction instruction %blockSize.addr.09 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 2: induction instruction %incdec.ptr = getelementptr inbounds i32, ptr %pDst.addr.08, i32 1
+; CHECK: Cost of 0 for VF 2: induction instruction %pDst.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 1 for VF 2: vp<[[VP7:%[0-9]+]]> = DERIVED-IV ir<0> + vp<[[VP6:%[0-9]+]]> * ir<4>
+; CHECK: Cost of 0 for VF 2: vp<[[VP8:%[0-9]+]]> = SCALAR-STEPS vp<[[VP7]]>, ir<4>, vp<[[VP0:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep> = ptradd ir<%pSrc>, vp<[[VP8]]>
+; CHECK: Cost of 1 for VF 2: vp<[[VP9:%[0-9]+]]> = DERIVED-IV ir<0> + vp<[[VP6]]> * ir<4>
+; CHECK: Cost of 0 for VF 2: vp<[[VP10:%[0-9]+]]> = SCALAR-STEPS vp<[[VP9]]>, ir<4>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 2: vp<[[VP11:%[0-9]+]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 6 for VF 2: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 12 for VF 2: WIDEN ir<%cmp1> = fcmp olt nnan ninf nsz ir<%0>, ir<0.000000e+00>
+; CHECK: Cost of 8 for VF 2: WIDEN ir<%cond> = select nnan ninf nsz ir<%cmp1>, ir<1.000000e+01>, ir<%0>
+; CHECK: Cost of 36 for VF 2: WIDEN-CAST ir<%conv> = fptosi ir<%cond> to i32
+; CHECK: Cost of 0 for VF 2: vp<[[VP12:%[0-9]+]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 18 for VF 2: WIDEN store vp<[[VP12]]>, ir<%conv>
+; CHECK: Cost of 0 for VF 2: EMIT vp<%index.next> = add nuw vp<[[VP6]]>, vp<[[VP1:%[0-9]+]]>
+; CHECK: Cost of 1 for VF 2: EMIT branch-on-count vp<%index.next>, vp<[[VP2:%[0-9]+]]>
+; CHECK: Cost of 0 for VF 2: vector loop backedge
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3:%[0-9]+]]>, middle.block ], [ ir<%pSrc>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4:%[0-9]+]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5:%[0-9]+]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 2: IR %pSrc.addr.010 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrc, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %blockSize.addr.09 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %pDst.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 2: IR %0 = load float, ptr %pSrc.addr.010, align 4
+; CHECK: Cost of 0 for VF 2: IR %cmp1 = fcmp nnan ninf nsz olt float %0, 0.000000e+00
+; CHECK: Cost of 0 for VF 2: IR %cond = select nnan ninf nsz i1 %cmp1, float 1.000000e+01, float %0
+; CHECK: Cost of 0 for VF 2: IR %conv = fptosi float %cond to i32
+; CHECK: Cost of 0 for VF 2: IR %incdec.ptr = getelementptr inbounds i32, ptr %pDst.addr.08, i32 1
+; CHECK: Cost of 0 for VF 2: IR store i32 %conv, ptr %pDst.addr.08, align 4
+; CHECK: Cost of 0 for VF 2: IR %incdec.ptr2 = getelementptr inbounds float, ptr %pSrc.addr.010, i32 1
+; CHECK: Cost of 0 for VF 2: IR %dec = add i32 %blockSize.addr.09, -1
+; CHECK: Cost of 0 for VF 2: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 0 for VF 2: vp<[[VP3]]> = DERIVED-IV ir<%pSrc> + vp<[[VP2]]> * ir<4>
+; CHECK: Cost of 1 for VF 2: vp<[[VP4]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 2: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<4>
+; CHECK: Cost of 1 for VF 2: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 2: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 2: 84 (Estimated cost per lane: 42)
+; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr2 = getelementptr inbounds float, ptr %pSrc.addr.010, i32 1
+; CHECK: Cost of 0 for VF 4: induction instruction %pSrc.addr.010 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrc, %while.body.preheader ]
+; CHECK: Cost of 1 for VF 4: induction instruction %dec = add i32 %blockSize.addr.09, -1
+; CHECK: Cost of 0 for VF 4: induction instruction %blockSize.addr.09 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ]
+; CHECK: Cost of 0 for VF 4: induction instruction %incdec.ptr = getelementptr inbounds i32, ptr %pDst.addr.08, i32 1
+; CHECK: Cost of 0 for VF 4: induction instruction %pDst.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %pDst, %while.body.preheader ]
+; CHECK: Cost of 1 for VF 4: vp<[[VP7]]> = DERIVED-IV ir<0> + vp<[[VP6]]> * ir<4>
+; CHECK: Cost of 0 for VF 4: vp<[[VP8]]> = SCALAR-STEPS vp<[[VP7]]>, ir<4>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep> = ptradd ir<%pSrc>, vp<[[VP8]]>
+; CHECK: Cost of 1 for VF 4: vp<[[VP9]]> = DERIVED-IV ir<0> + vp<[[VP6]]> * ir<4>
+; CHECK: Cost of 0 for VF 4: vp<[[VP10]]> = SCALAR-STEPS vp<[[VP9]]>, ir<4>, vp<[[VP0]]>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%next.gep>.1 = ptradd ir<%pDst>, vp<[[VP10]]>
+; CHECK: Cost of 0 for VF 4: vp<[[VP11]]> = vector-pointer vp<%next.gep>, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN ir<%0> = load vp<[[VP11]]>
+; CHECK: Cost of 24 for VF 4: WIDEN ir<%cmp1> = fcmp olt nnan ninf nsz ir<%0>, ir<0.000000e+00>
+; CHECK: Cost of 16 for VF 4: WIDEN ir<%cond> = select nnan ninf nsz ir<%cmp1>, ir<1.000000e+01>, ir<%0>
+; CHECK: Cost of 72 for VF 4: WIDEN-CAST ir<%conv> = fptosi ir<%cond> to i32
+; CHECK: Cost of 0 for VF 4: vp<[[VP12]]> = vector-pointer vp<%next.gep>.1, ir<1>
+; CHECK: Cost of 2 for VF 4: WIDEN store vp<[[VP12]]>, ir<%conv>
+; CHECK: Cost of 0 for VF 4: EMIT vp<%index.next> = add nuw vp<[[VP6]]>, vp<[[VP1]]>
+; CHECK: Cost of 1 for VF 4: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: vector loop backedge
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val> = phi [ vp<[[VP3]]>, middle.block ], [ ir<%pSrc>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val>.1 = phi [ vp<[[VP4]]>, middle.block ], [ ir<%blockSize>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: EMIT-SCALAR vp<%bc.resume.val>.2 = phi [ vp<[[VP5]]>, middle.block ], [ ir<%pDst>, ir-bb<while.body.preheader> ]
+; CHECK: Cost of 0 for VF 4: IR %pSrc.addr.010 = phi ptr [ %incdec.ptr2, %while.body ], [ %pSrc, %while.body.preheader ] (extra operand: vp<%bc.resume.val> from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %blockSize.addr.09 = phi i32 [ %dec, %while.body ], [ %blockSize, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.1 from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %pDst.addr.08 = phi ptr [ %incdec.ptr, %while.body ], [ %pDst, %while.body.preheader ] (extra operand: vp<%bc.resume.val>.2 from scalar.ph)
+; CHECK: Cost of 0 for VF 4: IR %0 = load float, ptr %pSrc.addr.010, align 4
+; CHECK: Cost of 0 for VF 4: IR %cmp1 = fcmp nnan ninf nsz olt float %0, 0.000000e+00
+; CHECK: Cost of 0 for VF 4: IR %cond = select nnan ninf nsz i1 %cmp1, float 1.000000e+01, float %0
+; CHECK: Cost of 0 for VF 4: IR %conv = fptosi float %cond to i32
+; CHECK: Cost of 0 for VF 4: IR %incdec.ptr = getelementptr inbounds i32, ptr %pDst.addr.08, i32 1
+; CHECK: Cost of 0 for VF 4: IR store i32 %conv, ptr %pDst.addr.08, align 4
+; CHECK: Cost of 0 for VF 4: IR %incdec.ptr2 = getelementptr inbounds float, ptr %pSrc.addr.010, i32 1
+; CHECK: Cost of 0 for VF 4: IR %dec = add i32 %blockSize.addr.09, -1
+; CHECK: Cost of 0 for VF 4: IR %cmp.not = icmp eq i32 %dec, 0
+; CHECK: Cost of 0 for VF 4: vp<[[VP3]]> = DERIVED-IV ir<%pSrc> + vp<[[VP2]]> * ir<4>
+; CHECK: Cost of 1 for VF 4: vp<[[VP4]]> = DERIVED-IV ir<%blockSize> + vp<[[VP2]]> * ir<-1>
+; CHECK: Cost of 0 for VF 4: vp<[[VP5]]> = DERIVED-IV ir<%pDst> + vp<[[VP2]]> * ir<4>
+; CHECK: Cost of 1 for VF 4: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
+; CHECK: Cost of 0 for VF 4: EMIT branch-on-cond vp<%cmp.n>
+; CHECK: Cost for VF 4: 120 (Estimated cost per lane: 30)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp.not7 = icmp eq i32 %blockSize, 0
br i1 %cmp.not7, label %while.end, label %while.body
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
index 326e7ddcd0647..d551cffb86f8b 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --version 6
; REQUIRES: asserts
; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=false %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-NOPRESSURE
; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PRESSURE
@@ -9,16 +10,16 @@ target triple = "thumbv8.1m.main-unknown-none-eabihf"
; In this function the spills make it not profitable to vectorize if considering
; register pressure.
define void @spills_not_profitable(ptr %in1, ptr %in2, ptr %out, i32 %n) {
-; CHECK-LABEL: LV: Checking a loop in 'spills_not_profitable'
-; CHECK: LV: Scalar loop costs: 86
-; CHECK-NOPRESSURE: Cost for VF 2: 394 (Estimated cost per lane: 197.
-; CHECK-NOPRESSURE: Cost for VF 4: 338 (Estimated cost per lane: 84.
-; CHECK-NOPRESSURE: LV: Selecting VF: 4
-; CHECK-PRESSURE: LV(REG): Cost of 50 from 25 spills of Generic::VectorRC
-; CHECK-PRESSURE-NEXT: Cost for VF 2: 444 (Estimated cost per lane: 222.
-; CHECK-PRESSURE: LV(REG): Cost of 50 from 25 spills of Generic::VectorRC
-; CHECK-PRESSURE-NEXT: Cost for VF 4: 388 (Estimated cost per lane: 97.
-; CHECK-PRESSURE: LV: Selecting VF: 1
+; CHECK-NOPRESSURE-LABEL: 'spills_not_profitable'
+; CHECK-NOPRESSURE: Cost for VF 2: 394 (Estimated cost per lane: 197)
+; CHECK-NOPRESSURE: Cost for VF 4: 338 (Estimated cost per lane: 84.5)
+; CHECK-NOPRESSURE: LV: Selecting VF: 4.
+;
+; CHECK-PRESSURE-LABEL: 'spills_not_profitable'
+; CHECK-PRESSURE: Cost for VF 2: 444 (Estimated cost per lane: 222)
+; CHECK-PRESSURE: Cost for VF 4: 388 (Estimated cost per lane: 97)
+; CHECK-PRESSURE: LV: Selecting VF: 1.
+;
entry:
%cmp = icmp eq i32 %n, 0
br i1 %cmp, label %exit, label %for.body
@@ -170,15 +171,16 @@ exit:
; In this function we have spills but it is still profitable to vectorize when
; considering register pressure.
define void @spills_profitable(ptr %in1, ptr %in2, ptr %out, i32 %n, i32 %m) {
-; CHECK-LABEL: LV: Checking a loop in 'spills_profitable'
-; CHECK: LV: Scalar loop costs: 54
-; CHECK-NOPRESSURE: Cost for VF 2: 1535 (Estimated cost per lane: 767.
-; CHECK-NOPRESSURE: Cost for VF 4: 43 (Estimated cost per lane: 10.
-; CHECK-PRESSURE: LV(REG): Cost of 4 from 2 spills of Generic::ScalarRC
-; CHECK-PRESSURE-NEXT: Cost for VF 2: 1539 (Estimated cost per lane: 769.
-; CHECK-PRESSURE: LV(REG): Cost of 6 from 3 spills of Generic::VectorRC
-; CHECK-PRESSURE-NEXT: Cost for VF 4: 49 (Estimated cost per lane: 12.
-; CHECK: LV: Selecting VF: 4
+; CHECK-NOPRESSURE-LABEL: 'spills_profitable'
+; CHECK-NOPRESSURE: Cost for VF 2: 1535 (Estimated cost per lane: 767.5)
+; CHECK-NOPRESSURE: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK-NOPRESSURE: LV: Selecting VF: 4.
+;
+; CHECK-PRESSURE-LABEL: 'spills_profitable'
+; CHECK-PRESSURE: Cost for VF 2: 1539 (Estimated cost per lane: 769.5)
+; CHECK-PRESSURE: Cost for VF 4: 49 (Estimated cost per lane: 12.25)
+; CHECK-PRESSURE: LV: Selecting VF: 4.
+;
entry:
%cmp = icmp eq i32 %n, 0
br i1 %cmp, label %exit, label %for.body.preheader
@@ -266,3 +268,5 @@ exit:
store i64 %acc3.exit, ptr %arrayidx45, align 8
ret void
}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
index 6a0a3410a9585..6141a59684f82 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 -vplan-print-metadata=false < %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: 13.5)
+; 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: 13.5)
+; 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.5)
+; 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: 28.75)
+; 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.5)
+; 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: 28.75)
+; 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: 27.875)
+; 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: 15.5)
+; 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.5)
+; 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 per lane: 26.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_shorts_split_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; 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: 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: 15.5)
+; 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.5)
+; CHECK: LV: Selecting VF: 4.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -360,43 +439,59 @@ define hidden void @four_shorts_split_op(ptr noalias nocapture noundef writeonly
br i1 %34, label %6, label %7
}
-; CHECK-LABEL: four_shorts_interleave_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_interleave_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_shorts_interleave_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: 15.5)
+; 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.5)
+; CHECK: LV: Selecting VF: 4.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -438,53 +533,84 @@ define hidden void @four_shorts_interleave_op(ptr noalias nocapture noundef writ
br i1 %34, label %6, label %7
}
-; CHECK-LABEL: five_shorts
-; CHECK: LV: Scalar loop costs: 24.
-; 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: 99 (Estimated cost per lane: 49.
-; CHECK: Cost of 42 for VF 4: INTERLEAVE-GROUP with factor 5, 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-NEXT: ir<%34> = load from index 4
-; CHECK: Cost of 42 for VF 4: INTERLEAVE-GROUP with factor 5, 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-NEXT: store ir<%37> to index 4
-; CHECK: Cost for VF 4: 135 (Estimated cost per lane: 33.
-; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, 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-NEXT: ir<%34> = load from index 4
-; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, 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-NEXT: store ir<%37> to index 4
-; CHECK: Cost for VF 8: 261 (Estimated cost per lane: 32.
-; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, 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-NEXT: ir<%34> = load from index 4
-; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, 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-NEXT: store ir<%37> to index 4
-; CHECK: Cost for VF 16: 513 (Estimated cost per lane: 32.
-; CHECK: LV: Selecting VF: 1.
define hidden void @five_shorts(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'five_shorts'
+; CHECK: LV: Scalar loop costs: 24.
+; 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 of 6 for VF 2: REPLICATE ir<%28> = load ir<%27>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%30> = load ir<%29>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%31>, ir<%32>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%34> = load ir<%33>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%36> = load ir<%35>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%37>, ir<%38>
+; CHECK: Cost for VF 2: 99 (Estimated cost per lane: 49.5)
+; CHECK: Cost of 42 for VF 4: INTERLEAVE-GROUP with factor 5, 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: ir<%34> = load from index 4
+; CHECK: Cost of 42 for VF 4: INTERLEAVE-GROUP with factor 5, 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: ir<%36> = load from index 4
+; CHECK: Cost of 42 for VF 4: INTERLEAVE-GROUP with factor 5, 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: store ir<%37> to index 4
+; CHECK: Cost for VF 4: 135 (Estimated cost per lane: 33.75)
+; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, 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: ir<%34> = load from index 4
+; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, 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: ir<%36> = load from index 4
+; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, 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: store ir<%37> to index 4
+; CHECK: Cost for VF 8: 261 (Estimated cost per lane: 32.625)
+; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, 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: ir<%34> = load from index 4
+; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, 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: ir<%36> = load from index 4
+; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, 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: store ir<%37> to index 4
+; CHECK: Cost for VF 16: 513 (Estimated cost per lane: 32.0625)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -533,35 +659,48 @@ define hidden void @five_shorts(ptr noalias nocapture noundef writeonly %0, ptr
br i1 %40, label %6, label %7
}
-; CHECK-LABEL: two_bytes_same_op
-; CHECK: LV: Scalar loop costs: 12.
-; 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: 52 (Estimated cost per lane: 26.
-; CHECK: Cost of 11 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 11 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: 61 (Estimated cost per lane: 15.
-; CHECK: Cost of 7 for VF 8: 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 8: 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 8: 33 (Estimated cost per lane: 4.
-; CHECK: Cost of 6 for VF 16: 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 16: 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 16: 30 (Estimated cost per lane: 1.
-; CHECK: LV: Selecting VF: 16.
define hidden void @two_bytes_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'two_bytes_same_op'
+; CHECK: LV: Scalar loop costs: 12.
+; 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 for VF 2: 52 (Estimated cost per lane: 26)
+; CHECK: Cost of 11 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 11 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 11 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: 61 (Estimated cost per lane: 15.25)
+; CHECK: Cost of 7 for VF 8: 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 8: 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 8: 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 8: 33 (Estimated cost per lane: 4.125)
+; CHECK: Cost of 6 for VF 16: 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 16: 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 16: 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 16: 30 (Estimated cost per lane: 1.875)
+; CHECK: LV: Selecting VF: 16.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -589,35 +728,48 @@ define hidden void @two_bytes_same_op(ptr noalias nocapture noundef writeonly %0
br i1 %22, label %6, label %7
}
-; CHECK-LABEL: two_bytes_vary_op
-; CHECK: LV: Scalar loop costs: 12.
-; 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: 47 (Estimated cost per lane: 23.
-; CHECK: Cost of 11 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 11 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: 50 (Estimated cost per lane: 12.
-; CHECK: Cost of 7 for VF 8: 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 8: 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 8: 30 (Estimated cost per lane: 3.
-; CHECK: Cost of 6 for VF 16: 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 16: 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 16: 27 (Estimated cost per lane: 1.
-; CHECK: LV: Selecting VF: 16.
define hidden void @two_bytes_vary_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'two_bytes_vary_op'
+; CHECK: LV: Scalar loop costs: 12.
+; 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 for VF 2: 47 (Estimated cost per lane: 23.5)
+; CHECK: Cost of 11 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 11 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 11 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: 50 (Estimated cost per lane: 12.5)
+; CHECK: Cost of 7 for VF 8: 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 8: 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 8: 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 8: 30 (Estimated cost per lane: 3.75)
+; CHECK: Cost of 6 for VF 16: 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 16: 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 16: 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 16: 27 (Estimated cost per lane: 1.6875)
+; CHECK: LV: Selecting VF: 16.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -645,26 +797,51 @@ define hidden void @two_bytes_vary_op(ptr noalias nocapture noundef writeonly %0
br i1 %22, label %6, label %7
}
-; CHECK-LABEL: three_bytes_same_op
-; 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: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.
-; CHECK: LV: Selecting VF: 1.
define hidden void @three_bytes_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'three_bytes_same_op'
+; 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.5)
+; 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: 28.75)
+; 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: 27.875)
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%16> = load ir<%15>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%18> = load ir<%17>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%19>, ir<%20>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%22> = load ir<%21>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%24> = load ir<%23>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%25>, ir<%26>
+; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4375)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -699,26 +876,51 @@ define hidden void @three_bytes_same_op(ptr noalias nocapture noundef writeonly
br i1 %28, label %6, label %7
}
-; CHECK-LABEL: three_bytes_interleave_op
-; 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: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
-; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
-; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.
-; CHECK: LV: Selecting VF: 1.
define hidden void @three_bytes_interleave_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'three_bytes_interleave_op'
+; 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.5)
+; 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: 28.75)
+; 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: 27.875)
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%16> = load ir<%15>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%18> = load ir<%17>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%19>, ir<%20>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%22> = load ir<%21>
+; CHECK: Cost of 48 for VF 16: REPLICATE ir<%24> = load ir<%23>
+; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%25>, ir<%26>
+; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4375)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -753,47 +955,72 @@ define hidden void @three_bytes_interleave_op(ptr noalias nocapture noundef writ
br i1 %28, label %6, label %7
}
-; CHECK-LABEL: four_bytes_same_op
-; CHECK: LV: Scalar loop costs: 20.
-; 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: 80 (Estimated cost per lane: 40.
-; 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 26 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 26 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: 86 (Estimated cost per lane: 10.
-; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 16: 404 (Estimated cost per lane: 25.
-; CHECK: LV: Selecting VF: 8.
define hidden void @four_bytes_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_bytes_same_op'
+; CHECK: LV: Scalar loop costs: 20.
+; 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 of 6 for VF 2: REPLICATE ir<%28> = load ir<%27>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%30> = load ir<%29>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%31>, ir<%32>
+; CHECK: Cost for VF 2: 80 (Estimated cost per lane: 40)
+; 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: 15.5)
+; CHECK: Cost of 26 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 26 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 26 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: 86 (Estimated cost per lane: 10.75)
+; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 132 for VF 16: 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 16: 404 (Estimated cost per lane: 25.25)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -835,47 +1062,72 @@ define hidden void @four_bytes_same_op(ptr noalias nocapture noundef writeonly %
br i1 %34, label %6, label %7
}
-; CHECK-LABEL: four_bytes_split_op
-; CHECK: LV: Scalar loop costs: 20.
-; 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: 90 (Estimated cost per lane: 45.
-; 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: 84 (Estimated cost per lane: 21.
-; CHECK: Cost of 26 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 26 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: 92 (Estimated cost per lane: 11.
-; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 16: 410 (Estimated cost per lane: 25.
-; CHECK: LV: Selecting VF: 8.
define hidden void @four_bytes_split_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_bytes_split_op'
+; CHECK: LV: Scalar loop costs: 20.
+; 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 of 6 for VF 2: REPLICATE ir<%28> = load ir<%27>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%30> = load ir<%29>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%31>, ir<%32>
+; CHECK: Cost for VF 2: 90 (Estimated cost per lane: 45)
+; 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: 84 (Estimated cost per lane: 21)
+; CHECK: Cost of 26 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 26 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 26 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: 92 (Estimated cost per lane: 11.5)
+; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 132 for VF 16: 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 16: 410 (Estimated cost per lane: 25.625)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -918,47 +1170,72 @@ define hidden void @four_bytes_split_op(ptr noalias nocapture noundef writeonly
}
-; CHECK-LABEL: four_bytes_interleave_op
-; CHECK: LV: Scalar loop costs: 20.
-; 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: 80 (Estimated cost per lane: 40.
-; 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 26 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 26 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: 86 (Estimated cost per lane: 10.
-; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 16: 404 (Estimated cost per lane: 25.
-; CHECK: LV: Selecting VF: 8.
define hidden void @four_bytes_interleave_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_bytes_interleave_op'
+; CHECK: LV: Scalar loop costs: 20.
+; 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 of 6 for VF 2: REPLICATE ir<%28> = load ir<%27>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%30> = load ir<%29>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%31>, ir<%32>
+; CHECK: Cost for VF 2: 80 (Estimated cost per lane: 40)
+; 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: 15.5)
+; CHECK: Cost of 26 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 26 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 26 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: 86 (Estimated cost per lane: 10.75)
+; CHECK: Cost of 132 for VF 16: 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 132 for VF 16: 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 132 for VF 16: 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 16: 404 (Estimated cost per lane: 25.25)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1001,86 +1278,123 @@ define hidden void @four_bytes_interleave_op(ptr noalias nocapture noundef write
}
-; CHECK-LABEL: eight_bytes_same_op
-; CHECK: LV: Scalar loop costs: 36.
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 2: 154 (Estimated cost per lane: 77.
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 4: 298 (Estimated cost per lane: 74.
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 8: 432 (Estimated cost per lane: 54.
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 828 (Estimated cost per lane: 51.
-; CHECK: LV: Selecting VF: 1.
define hidden void @eight_bytes_same_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'eight_bytes_same_op'
+; CHECK: LV: Scalar loop costs: 36.
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 2: 154 (Estimated cost per lane: 77)
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 4: 298 (Estimated cost per lane: 74.5)
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 8: 432 (Estimated cost per lane: 54)
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 16: 828 (Estimated cost per lane: 51.75)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1150,86 +1464,123 @@ define hidden void @eight_bytes_same_op(ptr noalias nocapture noundef writeonly
br i1 %58, label %6, label %7
}
-; CHECK-LABEL: eight_bytes_split_op
-; CHECK: LV: Scalar loop costs: 36.
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 2: 114 (Estimated cost per lane: 57.
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 4: 210 (Estimated cost per lane: 52.
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 8: 408 (Estimated cost per lane: 51.
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.
-; CHECK: LV: Selecting VF: 1.
define hidden void @eight_bytes_split_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'eight_bytes_split_op'
+; CHECK: LV: Scalar loop costs: 36.
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 2: 114 (Estimated cost per lane: 57)
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 4: 210 (Estimated cost per lane: 52.5)
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 8: 408 (Estimated cost per lane: 51)
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.25)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1299,86 +1650,123 @@ define hidden void @eight_bytes_split_op(ptr noalias nocapture noundef writeonly
br i1 %58, label %6, label %7
}
-; CHECK-LABEL: eight_bytes_interleave_op
-; CHECK: LV: Scalar loop costs: 36.
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 2: 114 (Estimated cost per lane: 57.
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 4: 210 (Estimated cost per lane: 52.
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 8: 408 (Estimated cost per lane: 51.
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: ir<%34> = load from index 4
-; CHECK-NEXT: ir<%40> = load from index 5
-; CHECK-NEXT: ir<%46> = load from index 6
-; CHECK-NEXT: ir<%52> = load from index 7
-; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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-NEXT: store ir<%37> to index 4
-; CHECK-NEXT: store ir<%43> to index 5
-; CHECK-NEXT: store ir<%49> to index 6
-; CHECK-NEXT: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.
-; CHECK: LV: Selecting VF: 1.
define hidden void @eight_bytes_interleave_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'eight_bytes_interleave_op'
+; CHECK: LV: Scalar loop costs: 36.
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 2: 114 (Estimated cost per lane: 57)
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 4: 210 (Estimated cost per lane: 52.5)
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 8: 408 (Estimated cost per lane: 51)
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%34> = load from index 4
+; CHECK: ir<%40> = load from index 5
+; CHECK: ir<%46> = load from index 6
+; CHECK: ir<%52> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: ir<%36> = load from index 4
+; CHECK: ir<%42> = load from index 5
+; CHECK: ir<%48> = load from index 6
+; CHECK: ir<%54> = load from index 7
+; CHECK: Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, 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: store ir<%37> to index 4
+; CHECK: store ir<%43> to index 5
+; CHECK: store ir<%49> to index 6
+; CHECK: store ir<%55> to index 7
+; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.25)
+; CHECK: LV: Selecting VF: 1.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1448,41 +1836,51 @@ define hidden void @eight_bytes_interleave_op(ptr noalias nocapture noundef writ
br i1 %58, label %6, label %7
}
-; CHECK-LABEL: four_bytes_into_four_ints_same_op
-; CHECK: LV: Scalar loop costs: 28.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: ir<%17> = load from index 0
-; CHECK-NEXT: ir<%27> = load from index 1
-; CHECK-NEXT: ir<%37> = load from index 2
-; CHECK-NEXT: ir<%47> = load from index 3
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%20> = load ir<%19>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: store ir<%18> to index 0
-; CHECK-NEXT: store ir<%28> to index 1
-; CHECK-NEXT: store ir<%38> to index 2
-; CHECK-NEXT: store ir<%48> to index 3
-; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44.
-; 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<%20> = load from index 1
-; CHECK-NEXT: ir<%30> = load from index 2
-; CHECK-NEXT: ir<%40> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%12>
-; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: ir<%17> = load from index 0
-; CHECK-NEXT: ir<%27> = load from index 1
-; CHECK-NEXT: ir<%37> = load from index 2
-; CHECK-NEXT: ir<%47> = load from index 3
-; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: store ir<%18> to index 0
-; CHECK-NEXT: store ir<%28> to index 1
-; CHECK-NEXT: store ir<%38> to index 2
-; CHECK-NEXT: store ir<%48> to index 3
-; CHECK: Cost for VF 4: 104 (Estimated cost per lane: 26.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_bytes_into_four_ints_same_op(ptr noalias nocapture noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_bytes_into_four_ints_same_op'
+; CHECK: LV: Scalar loop costs: 28.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12>
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: ir<%17> = load from index 0
+; CHECK: ir<%27> = load from index 1
+; CHECK: ir<%37> = load from index 2
+; CHECK: ir<%47> = load from index 3
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%20> = load ir<%19>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%23> = load ir<%22>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%30> = load ir<%29>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%33> = load ir<%32>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%40> = load ir<%39>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%43> = load ir<%42>
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: store ir<%18> to index 0
+; CHECK: store ir<%28> to index 1
+; CHECK: store ir<%38> to index 2
+; CHECK: store ir<%48> to index 3
+; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%9>
+; CHECK: ir<%10> = load from index 0
+; CHECK: ir<%20> = load from index 1
+; CHECK: ir<%30> = load from index 2
+; CHECK: ir<%40> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%12>
+; CHECK: ir<%13> = load from index 0
+; CHECK: ir<%23> = load from index 1
+; CHECK: ir<%33> = load from index 2
+; CHECK: ir<%43> = load from index 3
+; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: ir<%17> = load from index 0
+; CHECK: ir<%27> = load from index 1
+; CHECK: ir<%37> = load from index 2
+; CHECK: ir<%47> = load from index 3
+; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: store ir<%18> to index 0
+; CHECK: store ir<%28> to index 1
+; CHECK: store ir<%38> to index 2
+; CHECK: store ir<%48> to index 3
+; CHECK: Cost for VF 4: 104 (Estimated cost per lane: 26)
+; CHECK: LV: Selecting VF: 4.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1540,31 +1938,41 @@ define hidden void @four_bytes_into_four_ints_same_op(ptr noalias nocapture noun
br i1 %50, label %6, label %7
}
-; CHECK-LABEL: four_bytes_into_four_ints_vary_op
-; CHECK: LV: Scalar loop costs: 21.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%18> = load ir<%17>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: store ir<%15> to index 0
-; CHECK-NEXT: store ir<%23> to index 1
-; CHECK-NEXT: store ir<%31> to index 2
-; CHECK-NEXT: store ir<%38> to index 3
-; CHECK: Cost for VF 2: 71 (Estimated cost per lane: 35.
-; 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<%18> = load from index 1
-; CHECK-NEXT: ir<%26> = load from index 2
-; CHECK-NEXT: ir<%34> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%12>
-; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
-; CHECK-NEXT: store ir<%15> to index 0
-; CHECK-NEXT: store ir<%23> to index 1
-; CHECK-NEXT: store ir<%31> to index 2
-; CHECK-NEXT: store ir<%38> to index 3
-; CHECK: Cost for VF 4: 80 (Estimated cost per lane: 20.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_bytes_into_four_ints_vary_op(ptr noalias nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'four_bytes_into_four_ints_vary_op'
+; CHECK: LV: Scalar loop costs: 21.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load ir<%9>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%18> = load ir<%17>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%21> = load ir<%20>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%26> = load ir<%25>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%29> = load ir<%28>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%34> = load ir<%33>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%36> = load ir<%35>
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: store ir<%15> to index 0
+; CHECK: store ir<%23> to index 1
+; CHECK: store ir<%31> to index 2
+; CHECK: store ir<%38> to index 3
+; CHECK: Cost for VF 2: 71 (Estimated cost per lane: 35.5)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%9>
+; CHECK: ir<%10> = load from index 0
+; CHECK: ir<%18> = load from index 1
+; CHECK: ir<%26> = load from index 2
+; CHECK: ir<%34> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%12>
+; CHECK: ir<%13> = load from index 0
+; CHECK: ir<%21> = load from index 1
+; CHECK: ir<%29> = load from index 2
+; CHECK: ir<%36> = load from index 3
+; CHECK: Cost of 24 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%16>
+; CHECK: store ir<%15> to index 0
+; CHECK: store ir<%23> to index 1
+; CHECK: store ir<%31> to index 2
+; CHECK: store ir<%38> to index 3
+; CHECK: Cost for VF 4: 80 (Estimated cost per lane: 20)
+; CHECK: LV: Selecting VF: 4.
+;
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %7
@@ -1613,31 +2021,32 @@ define hidden void @four_bytes_into_four_ints_vary_op(ptr noalias nocapture noun
br i1 %41, label %6, label %7
}
-; CHECK-LABEL: scale_uv_row_down2
-; CHECK: LV: Scalar loop costs: 10.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%10>
-; CHECK-NEXT: ir<%11> = load from index 0
-; CHECK-NEXT: ir<%13> = load from index 1
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%11> to index 0
-; CHECK-NEXT: store ir<%13> to index 1
-; CHECK: Cost for VF 4: 37 (Estimated cost per lane: 9.
-; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%10>
-; CHECK-NEXT: ir<%11> = load from index 0
-; CHECK-NEXT: ir<%13> = load from index 1
-; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%11> to index 0
-; CHECK-NEXT: store ir<%13> to index 1
-; CHECK: Cost for VF 8: 41 (Estimated cost per lane: 5.
-; CHECK: Cost of 68 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%10>
-; CHECK-NEXT: ir<%11> = load from index 0
-; CHECK-NEXT: ir<%13> = load from index 1
-; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%11> to index 0
-; CHECK-NEXT: store ir<%13> to index 1
-; CHECK: Cost for VF 16: 82 (Estimated cost per lane: 5.
-; CHECK: LV: Selecting VF: 8.
define hidden void @scale_uv_row_down2(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'scale_uv_row_down2'
+; CHECK: LV: Scalar loop costs: 10.
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%10>
+; CHECK: ir<%11> = load from index 0
+; CHECK: ir<%13> = load from index 1
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%11> to index 0
+; CHECK: store ir<%13> to index 1
+; CHECK: Cost for VF 4: 37 (Estimated cost per lane: 9.25)
+; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%10>
+; CHECK: ir<%11> = load from index 0
+; CHECK: ir<%13> = load from index 1
+; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%11> to index 0
+; CHECK: store ir<%13> to index 1
+; CHECK: Cost for VF 8: 41 (Estimated cost per lane: 5.125)
+; CHECK: Cost of 68 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%10>
+; CHECK: ir<%11> = load from index 0
+; CHECK: ir<%13> = load from index 1
+; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%11> to index 0
+; CHECK: store ir<%13> to index 1
+; CHECK: Cost for VF 16: 82 (Estimated cost per lane: 5.125)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %19
@@ -1662,45 +2071,64 @@ define hidden void @scale_uv_row_down2(ptr nocapture noundef readonly %0, i32 no
ret void
}
-; CHECK-LABEL: scale_uv_row_down2_box
-; CHECK: LV: Scalar loop costs: 26.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%14> = load vp<%next.gep> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%17> = load ir<%16> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%20> = load ir<%19> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%48>, ir<%49>
-; CHECK: Cost for VF 2: 80 (Estimated cost per lane: 40.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%14> = load from index 0
-; CHECK-NEXT: ir<%32> = load from index 1
-; CHECK-NEXT: ir<%17> = load from index 2
-; CHECK-NEXT: ir<%35> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%19>
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%30> to index 0
-; CHECK-NEXT: store ir<%48> to index 1
-; CHECK: Cost for VF 4: 75 (Estimated cost per lane: 18.
-; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%14> = load from index 0
-; CHECK-NEXT: ir<%32> = load from index 1
-; CHECK-NEXT: ir<%17> = load from index 2
-; CHECK-NEXT: ir<%35> = load from index 3
-; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%19>
-; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%30> to index 0
-; CHECK-NEXT: store ir<%48> to index 1
-; CHECK: Cost for VF 8: 91 (Estimated cost per lane: 11.
-; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%14> = load from index 0
-; CHECK-NEXT: ir<%32> = load from index 1
-; CHECK-NEXT: ir<%17> = load from index 2
-; CHECK-NEXT: ir<%35> = load from index 3
-; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%19>
-; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%30> to index 0
-; CHECK-NEXT: store ir<%48> to index 1
-; CHECK: Cost for VF 16: 324 (Estimated cost per lane: 20.
-; CHECK: LV: Selecting VF: 8.
define hidden void @scale_uv_row_down2_box(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'scale_uv_row_down2_box'
+; CHECK: LV: Scalar loop costs: 26.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%14> = load vp<%next.gep>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%17> = load ir<%16>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%20> = load ir<%19>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%23> = load ir<%22>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%30>, vp<%next.gep>.1
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%32> = load ir<%31>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%35> = load ir<%34>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%38> = load ir<%37>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%41> = load ir<%40>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%48>, ir<%49>
+; CHECK: Cost for VF 2: 80 (Estimated cost per lane: 40)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%14> = load from index 0
+; CHECK: ir<%32> = load from index 1
+; CHECK: ir<%17> = load from index 2
+; CHECK: ir<%35> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%19>
+; CHECK: ir<%20> = load from index 0
+; CHECK: ir<%38> = load from index 1
+; CHECK: ir<%23> = load from index 2
+; CHECK: ir<%41> = load from index 3
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%30> to index 0
+; CHECK: store ir<%48> to index 1
+; CHECK: Cost for VF 4: 75 (Estimated cost per lane: 18.75)
+; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%14> = load from index 0
+; CHECK: ir<%32> = load from index 1
+; CHECK: ir<%17> = load from index 2
+; CHECK: ir<%35> = load from index 3
+; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, ir<%19>
+; CHECK: ir<%20> = load from index 0
+; CHECK: ir<%38> = load from index 1
+; CHECK: ir<%23> = load from index 2
+; CHECK: ir<%41> = load from index 3
+; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%30> to index 0
+; CHECK: store ir<%48> to index 1
+; CHECK: Cost for VF 8: 91 (Estimated cost per lane: 11.375)
+; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%14> = load from index 0
+; CHECK: ir<%32> = load from index 1
+; CHECK: ir<%17> = load from index 2
+; CHECK: ir<%35> = load from index 3
+; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%19>
+; CHECK: ir<%20> = load from index 0
+; CHECK: ir<%38> = load from index 1
+; CHECK: ir<%23> = load from index 2
+; CHECK: ir<%41> = load from index 3
+; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%30> to index 0
+; CHECK: store ir<%48> to index 1
+; CHECK: Cost for VF 16: 324 (Estimated cost per lane: 20.25)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %54
@@ -1762,42 +2190,45 @@ define hidden void @scale_uv_row_down2_box(ptr nocapture noundef readonly %0, i3
ret void
}
-; CHECK-LABEL: scale_uv_row_down2_linear
-; CHECK: LV: Scalar loop costs: 18.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load vp<%next.gep> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%18>, vp<%next.gep>.1 (!alias.scope {{.*}}, !noalias {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%28>, ir<%29>
-; CHECK: Cost for VF 2: 52 (Estimated cost per lane: 26.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%10> = load from index 0
-; CHECK-NEXT: ir<%20> = load from index 1
-; CHECK-NEXT: ir<%13> = load from index 2
-; CHECK-NEXT: ir<%23> = load from index 3
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%18> to index 0
-; CHECK-NEXT: store ir<%28> to index 1
-; CHECK: Cost for VF 4: 49 (Estimated cost per lane: 12.
-; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%10> = load from index 0
-; CHECK-NEXT: ir<%20> = load from index 1
-; CHECK-NEXT: ir<%13> = load from index 2
-; CHECK-NEXT: ir<%23> = load from index 3
-; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%18> to index 0
-; CHECK-NEXT: store ir<%28> to index 1
-; CHECK: Cost for VF 8: 57 (Estimated cost per lane: 7.
-; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
-; CHECK-NEXT: ir<%10> = load from index 0
-; CHECK-NEXT: ir<%20> = load from index 1
-; CHECK-NEXT: ir<%13> = load from index 2
-; CHECK-NEXT: ir<%23> = load from index 3
-; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
-; CHECK-NEXT: store ir<%18> to index 0
-; CHECK-NEXT: store ir<%28> to index 1
-; CHECK: Cost for VF 16: 176 (Estimated cost per lane: 11.
-; CHECK: LV: Selecting VF: 8.
define hidden void @scale_uv_row_down2_linear(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, i32 noundef %3) {
+; CHECK-LABEL: 'scale_uv_row_down2_linear'
+; CHECK: LV: Scalar loop costs: 18.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%10> = load vp<%next.gep>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%13> = load ir<%12>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%18>, vp<%next.gep>.1
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%20> = load ir<%19>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%23> = load ir<%22>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%28>, ir<%29>
+; CHECK: Cost for VF 2: 52 (Estimated cost per lane: 26)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%10> = load from index 0
+; CHECK: ir<%20> = load from index 1
+; CHECK: ir<%13> = load from index 2
+; CHECK: ir<%23> = load from index 3
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%18> to index 0
+; CHECK: store ir<%28> to index 1
+; CHECK: Cost for VF 4: 49 (Estimated cost per lane: 12.25)
+; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%10> = load from index 0
+; CHECK: ir<%20> = load from index 1
+; CHECK: ir<%13> = load from index 2
+; CHECK: ir<%23> = load from index 3
+; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%18> to index 0
+; CHECK: store ir<%28> to index 1
+; CHECK: Cost for VF 8: 57 (Estimated cost per lane: 7.125)
+; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
+; CHECK: ir<%10> = load from index 0
+; CHECK: ir<%20> = load from index 1
+; CHECK: ir<%13> = load from index 2
+; CHECK: ir<%23> = load from index 3
+; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
+; CHECK: store ir<%18> to index 0
+; CHECK: store ir<%28> to index 1
+; CHECK: Cost for VF 16: 176 (Estimated cost per lane: 11)
+; CHECK: LV: Selecting VF: 8.
+;
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %34
@@ -1837,30 +2268,31 @@ define hidden void @scale_uv_row_down2_linear(ptr nocapture noundef readonly %0,
ret void
}
-; CHECK-LABEL: two_floats_same_op
-; CHECK: LV: Scalar loop costs: 14.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul8> to index 1
-; CHECK: Cost for VF 2: 29 (Estimated cost per lane: 14.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul8> to index 1
-; CHECK: Cost for VF 4: 26 (Estimated cost per lane: 6.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_same_op'
+; CHECK: LV: Scalar loop costs: 14.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul8> to index 1
+; CHECK: Cost for VF 2: 29 (Estimated cost per lane: 14.5)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul8> to index 1
+; CHECK: Cost for VF 4: 26 (Estimated cost per lane: 6.5)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp21.not = icmp eq i32 %N, 0
br i1 %cmp21.not, label %for.cond.cleanup, label %for.body
@@ -1889,30 +2321,31 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_floats_vary_op
-; CHECK: LV: Scalar loop costs: 14.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 2: 29 (Estimated cost per lane: 14.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 4: 26 (Estimated cost per lane: 6.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 14.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 2: 29 (Estimated cost per lane: 14.5)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 4: 26 (Estimated cost per lane: 6.5)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp20.not = icmp eq i32 %N, 0
br i1 %cmp20.not, label %for.cond.cleanup, label %for.body
@@ -1941,27 +2374,29 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_bytes_two_floats_same_op
-; CHECK: LV: Scalar loop costs: 18.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK: Cost for VF 2: 51 (Estimated cost per lane: 25.
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK: Cost for VF 4: 48 (Estimated cost per lane: 12.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_bytes_two_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_bytes_two_floats_same_op'
+; CHECK: LV: Scalar loop costs: 18.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%3> = load ir<%y9>
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: Cost for VF 2: 51 (Estimated cost per lane: 25.5)
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: Cost for VF 4: 48 (Estimated cost per lane: 12)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp24.not = icmp eq i32 %N, 0
br i1 %cmp24.not, label %for.cond.cleanup, label %for.body
@@ -1994,27 +2429,29 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_bytes_two_floats_vary_op
-; CHECK: LV: Scalar loop costs: 18.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 2: 51 (Estimated cost per lane: 25.
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 4: 48 (Estimated cost per lane: 12.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_bytes_two_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_bytes_two_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 18.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%3> = load ir<%y9>
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 2: 51 (Estimated cost per lane: 25.5)
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 4: 48 (Estimated cost per lane: 12)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp23.not = icmp eq i32 %N, 0
br i1 %cmp23.not, label %for.cond.cleanup, label %for.body
@@ -2047,29 +2484,30 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_floats_two_bytes_same_op
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv9>, ir<%y11>
-; CHECK: Cost for VF 2: 46 (Estimated cost per lane: 23.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_two_bytes_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_two_bytes_same_op'
+; CHECK: LV: Scalar loop costs: 16.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv9>, ir<%y11>
+; CHECK: Cost for VF 2: 46 (Estimated cost per lane: 23)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp22.not = icmp eq i32 %N, 0
br i1 %cmp22.not, label %for.cond.cleanup, label %for.body
@@ -2100,29 +2538,30 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_floats_two_bytes_vary_op
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv8>
-; CHECK: Cost for VF 2: 46 (Estimated cost per lane: 23.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_two_bytes_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_two_bytes_vary_op'
+; CHECK: LV: Scalar loop costs: 16.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv8>, ir<%y10>
+; CHECK: Cost for VF 2: 46 (Estimated cost per lane: 23)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp21.not = icmp eq i32 %N, 0
br i1 %cmp21.not, label %for.cond.cleanup, label %for.body
@@ -2153,30 +2592,31 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_shorts_two_floats_same_op
-; CHECK: LV: Scalar loop costs: 18.
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK: Cost for VF 2: 45 (Estimated cost per lane: 22.
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK: Cost for VF 4: 36 (Estimated cost per lane: 9.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_shorts_two_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_shorts_two_floats_same_op'
+; CHECK: LV: Scalar loop costs: 18.
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: Cost for VF 2: 45 (Estimated cost per lane: 22.5)
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: Cost for VF 4: 36 (Estimated cost per lane: 9)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp24.not = icmp eq i32 %N, 0
br i1 %cmp24.not, label %for.cond.cleanup, label %for.body
@@ -2209,30 +2649,31 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_shorts_two_floats_vary_op
-; CHECK: LV: Scalar loop costs: 18.
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 2: 45 (Estimated cost per lane: 22.
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK: Cost for VF 4: 36 (Estimated cost per lane: 9.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_shorts_two_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_shorts_two_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 18.
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 2: 45 (Estimated cost per lane: 22.5)
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx4>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: Cost for VF 4: 36 (Estimated cost per lane: 9)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp23.not = icmp eq i32 %N, 0
br i1 %cmp23.not, label %for.cond.cleanup, label %for.body
@@ -2265,30 +2706,31 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_floats_two_shorts_same_op
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK: Cost for VF 2: 41 (Estimated cost per lane: 20.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK: Cost for VF 4: 35 (Estimated cost per lane: 8.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_two_shorts_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_two_shorts_same_op'
+; CHECK: LV: Scalar loop costs: 16.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: Cost for VF 2: 41 (Estimated cost per lane: 20.5)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: Cost for VF 4: 35 (Estimated cost per lane: 8.75)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp22.not = icmp eq i32 %N, 0
br i1 %cmp22.not, label %for.cond.cleanup, label %for.body
@@ -2319,30 +2761,31 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: two_floats_two_shorts_vary_op
-; CHECK: LV: Scalar loop costs: 16.
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK: Cost for VF 2: 41 (Estimated cost per lane: 20.
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK: Cost for VF 4: 35 (Estimated cost per lane: 8.
-; CHECK: LV: Selecting VF: 4.
define hidden void @two_floats_two_shorts_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'two_floats_two_shorts_vary_op'
+; CHECK: LV: Scalar loop costs: 16.
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 7 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 11 for VF 2: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: Cost for VF 2: 41 (Estimated cost per lane: 20.5)
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: Cost of 6 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: Cost of 7 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: Cost for VF 4: 35 (Estimated cost per lane: 8.75)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp21.not = icmp eq i32 %N, 0
br i1 %cmp21.not, label %for.cond.cleanup, label %for.body
@@ -2373,27 +2816,28 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_same_op
-; CHECK: LV: Scalar loop costs: 24.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul8> to index 1
-; CHECK-NEXT: store ir<%mul14> to index 2
-; CHECK-NEXT: store ir<%mul20> to index 3
-; CHECK: Cost for VF 2: 54 (Estimated cost per lane: 27.
-; CHECK: Cost for VF 4: 12 (Estimated cost per lane: 3.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_same_op'
+; CHECK: LV: Scalar loop costs: 24.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul8> to index 1
+; CHECK: store ir<%mul14> to index 2
+; CHECK: store ir<%mul20> to index 3
+; CHECK: Cost for VF 2: 54 (Estimated cost per lane: 27)
+; CHECK: Cost for VF 4: 12 (Estimated cost per lane: 3)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp45.not = icmp eq i32 %N, 0
br i1 %cmp45.not, label %for.cond.cleanup, label %for.body
@@ -2436,42 +2880,43 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_vary_op
-; CHECK: LV: Scalar loop costs: 24.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK-NEXT: store ir<%mul> to index 2
-; CHECK-NEXT: store ir<%div> to index 3
-; CHECK: Cost for VF 2: 54 (Estimated cost per lane: 27.
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%add> to index 0
-; CHECK-NEXT: store ir<%sub> to index 1
-; CHECK-NEXT: store ir<%mul> to index 2
-; CHECK-NEXT: store ir<%div> to index 3
-; CHECK: Cost for VF 4: 120 (Estimated cost per lane: 30.
-; CHECK: LV: Selecting VF: 1.
define hidden void @four_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 24.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: store ir<%mul> to index 2
+; CHECK: store ir<%div> to index 3
+; CHECK: Cost for VF 2: 54 (Estimated cost per lane: 27)
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%add> to index 0
+; CHECK: store ir<%sub> to index 1
+; CHECK: store ir<%mul> to index 2
+; CHECK: store ir<%div> to index 3
+; CHECK: Cost for VF 4: 120 (Estimated cost per lane: 30)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp42.not = icmp eq i32 %N, 0
br i1 %cmp42.not, label %for.cond.cleanup, label %for.body
@@ -2514,35 +2959,41 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_bytes_four_floats_same_op
-; CHECK: LV: Scalar loop costs: 32.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK-NEXT: store ir<%mul19> to index 2
-; CHECK-NEXT: store ir<%mul27> to index 3
-; CHECK: Cost for VF 2: 98 (Estimated cost per lane: 49.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK-NEXT: store ir<%mul19> to index 2
-; CHECK-NEXT: store ir<%mul27> to index 3
-; CHECK: Cost for VF 4: 108 (Estimated cost per lane: 27.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_bytes_four_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_bytes_four_floats_same_op'
+; CHECK: LV: Scalar loop costs: 32.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%3> = load ir<%y9>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%4> = load ir<%z>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%5> = load ir<%z17>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%6> = load ir<%w>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%7> = load ir<%w25>
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: store ir<%mul19> to index 2
+; CHECK: store ir<%mul27> to index 3
+; CHECK: Cost for VF 2: 98 (Estimated cost per lane: 49)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: store ir<%mul19> to index 2
+; CHECK: store ir<%mul27> to index 3
+; CHECK: Cost for VF 4: 108 (Estimated cost per lane: 27)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp52.not = icmp eq i32 %N, 0
br i1 %cmp52.not, label %for.cond.cleanup, label %for.body
@@ -2593,35 +3044,41 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_bytes_four_floats_vary_op
-; CHECK: LV: Scalar loop costs: 32.
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1> (!alias.scope {{.*}})
-; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y> (!alias.scope {{.*}})
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%add> to index 1
-; CHECK-NEXT: store ir<%div> to index 2
-; CHECK-NEXT: store ir<%sub> to index 3
-; CHECK: Cost for VF 2: 98 (Estimated cost per lane: 49.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%add> to index 1
-; CHECK-NEXT: store ir<%div> to index 2
-; CHECK-NEXT: store ir<%sub> to index 3
-; CHECK: Cost for VF 4: 108 (Estimated cost per lane: 27.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_bytes_four_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_bytes_four_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 32.
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%2> = load ir<%y>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%3> = load ir<%y9>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%4> = load ir<%z>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%5> = load ir<%z16>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%6> = load ir<%w>
+; CHECK: Cost of 6 for VF 2: REPLICATE ir<%7> = load ir<%w23>
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%add> to index 1
+; CHECK: store ir<%div> to index 2
+; CHECK: store ir<%sub> to index 3
+; CHECK: Cost for VF 2: 98 (Estimated cost per lane: 49)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%add> to index 1
+; CHECK: store ir<%div> to index 2
+; CHECK: store ir<%sub> to index 3
+; CHECK: Cost for VF 4: 108 (Estimated cost per lane: 27)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp49.not = icmp eq i32 %N, 0
br i1 %cmp49.not, label %for.cond.cleanup, label %for.body
@@ -2672,36 +3129,42 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_four_bytes_same_op
-; CHECK: LV: Scalar loop costs: 28.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv9>, ir<%y11>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv16>, ir<%z18>
-; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44.
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK-NEXT: store ir<%conv16> to index 2
-; CHECK-NEXT: store ir<%conv23> to index 3
-; CHECK: Cost for VF 4: 126 (Estimated cost per lane: 31.
-; CHECK: LV: Selecting VF: 1.
define hidden void @four_floats_four_bytes_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_four_bytes_same_op'
+; CHECK: LV: Scalar loop costs: 28.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv9>, ir<%y11>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv16>, ir<%z18>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv23>, ir<%w25>
+; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44)
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: store ir<%conv16> to index 2
+; CHECK: store ir<%conv23> to index 3
+; CHECK: Cost for VF 4: 126 (Estimated cost per lane: 31.5)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp48.not = icmp eq i32 %N, 0
br i1 %cmp48.not, label %for.cond.cleanup, label %for.body
@@ -2748,36 +3211,42 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_four_bytes_vary_op
-; CHECK: LV: Scalar loop costs: 28.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv8>, ir<%y10>
-; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv14>, ir<%z16>
-; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44.
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK-NEXT: store ir<%conv14> to index 2
-; CHECK-NEXT: store ir<%conv20> to index 3
-; CHECK: Cost for VF 4: 126 (Estimated cost per lane: 31.
-; CHECK: LV: Selecting VF: 1.
define hidden void @four_floats_four_bytes_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_four_bytes_vary_op'
+; CHECK: LV: Scalar loop costs: 28.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv>, ir<%arrayidx3>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv8>, ir<%y10>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv14>, ir<%z16>
+; CHECK: Cost of 6 for VF 2: REPLICATE store ir<%conv20>, ir<%w22>
+; CHECK: Cost for VF 2: 88 (Estimated cost per lane: 44)
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: store ir<%conv14> to index 2
+; CHECK: store ir<%conv20> to index 3
+; CHECK: Cost for VF 4: 126 (Estimated cost per lane: 31.5)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp45.not = icmp eq i32 %N, 0
br i1 %cmp45.not, label %for.cond.cleanup, label %for.body
@@ -2824,34 +3293,43 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_shorts_four_floats_same_op
-; CHECK: LV: Scalar loop costs: 32.
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK-NEXT: store ir<%mul19> to index 2
-; CHECK-NEXT: store ir<%mul27> to index 3
-; CHECK: Cost for VF 2: 78 (Estimated cost per lane: 39.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%mul11> to index 1
-; CHECK-NEXT: store ir<%mul19> to index 2
-; CHECK-NEXT: store ir<%mul27> to index 3
-; CHECK: Cost for VF 4: 100 (Estimated cost per lane: 25.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_shorts_four_floats_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_shorts_four_floats_same_op'
+; CHECK: LV: Scalar loop costs: 32.
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: store ir<%mul19> to index 2
+; CHECK: store ir<%mul27> to index 3
+; CHECK: Cost for VF 2: 78 (Estimated cost per lane: 39)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%mul11> to index 1
+; CHECK: store ir<%mul19> to index 2
+; CHECK: store ir<%mul27> to index 3
+; CHECK: Cost for VF 4: 100 (Estimated cost per lane: 25)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp52.not = icmp eq i32 %N, 0
br i1 %cmp52.not, label %for.cond.cleanup, label %for.body
@@ -2902,34 +3380,43 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_shorts_four_floats_vary_op
-; CHECK: LV: Scalar loop costs: 32.
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%add> to index 1
-; CHECK-NEXT: store ir<%div> to index 2
-; CHECK-NEXT: store ir<%sub> to index 3
-; CHECK: Cost for VF 2: 78 (Estimated cost per lane: 39.
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
-; CHECK-NEXT: store ir<%mul> to index 0
-; CHECK-NEXT: store ir<%add> to index 1
-; CHECK-NEXT: store ir<%div> to index 2
-; CHECK-NEXT: store ir<%sub> to index 3
-; CHECK: Cost for VF 4: 100 (Estimated cost per lane: 25.
-; CHECK: LV: Selecting VF: 4.
define hidden void @four_shorts_four_floats_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_shorts_four_floats_vary_op'
+; CHECK: LV: Scalar loop costs: 32.
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%add> to index 1
+; CHECK: store ir<%div> to index 2
+; CHECK: store ir<%sub> to index 3
+; CHECK: Cost for VF 2: 78 (Estimated cost per lane: 39)
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx4>
+; CHECK: store ir<%mul> to index 0
+; CHECK: store ir<%add> to index 1
+; CHECK: store ir<%div> to index 2
+; CHECK: store ir<%sub> to index 3
+; CHECK: Cost for VF 4: 100 (Estimated cost per lane: 25)
+; CHECK: LV: Selecting VF: 4.
+;
entry:
%cmp49.not = icmp eq i32 %N, 0
br i1 %cmp49.not, label %for.cond.cleanup, label %for.body
@@ -2980,38 +3467,43 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_four_shorts_same_op
-; CHECK: LV: Scalar loop costs: 28.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK-NEXT: store ir<%conv16> to index 2
-; CHECK-NEXT: store ir<%conv23> to index 3
-; CHECK: Cost for VF 2: 74 (Estimated cost per lane: 37.
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv9> to index 1
-; CHECK-NEXT: store ir<%conv16> to index 2
-; CHECK-NEXT: store ir<%conv23> to index 3
-; CHECK: Cost for VF 4: 118 (Estimated cost per lane: 29.
-; CHECK: LV: Selecting VF: 1.
define hidden void @four_floats_four_shorts_same_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_four_shorts_same_op'
+; CHECK: LV: Scalar loop costs: 28.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: store ir<%conv16> to index 2
+; CHECK: store ir<%conv23> to index 3
+; CHECK: Cost for VF 2: 74 (Estimated cost per lane: 37)
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv9> to index 1
+; CHECK: store ir<%conv16> to index 2
+; CHECK: store ir<%conv23> to index 3
+; CHECK: Cost for VF 4: 118 (Estimated cost per lane: 29.5)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp48.not = icmp eq i32 %N, 0
br i1 %cmp48.not, label %for.cond.cleanup, label %for.body
@@ -3058,38 +3550,43 @@ for.body:
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
-; CHECK-LABEL: four_floats_four_shorts_vary_op
-; CHECK: LV: Scalar loop costs: 28.
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4
-; CHECK-NEXT: ir<%1> = load from index 0
-; CHECK-NEXT: ir<%3> = load from index 1
-; CHECK-NEXT: ir<%5> = load from index 2
-; CHECK-NEXT: ir<%7> = load from index 3
-; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK-NEXT: store ir<%conv14> to index 2
-; CHECK-NEXT: store ir<%conv20> to index 3
-; CHECK: Cost for VF 2: 74 (Estimated cost per lane: 37.
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
-; CHECK-NEXT: ir<%0> = load from index 0
-; CHECK-NEXT: ir<%2> = load from index 1
-; CHECK-NEXT: ir<%4> = load from index 2
-; CHECK-NEXT: ir<%6> = load from index 3
-; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
-; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
-; CHECK-NEXT: store ir<%conv> to index 0
-; CHECK-NEXT: store ir<%conv8> to index 1
-; CHECK-NEXT: store ir<%conv14> to index 2
-; CHECK-NEXT: store ir<%conv20> to index 3
-; CHECK: Cost for VF 4: 118 (Estimated cost per lane: 29.
-; CHECK: LV: Selecting VF: 1.
define hidden void @four_floats_four_shorts_vary_op(ptr noundef readonly captures(none) %a, ptr noundef readonly captures(none) %b, ptr noundef writeonly captures(none) %res, i32 noundef %N) {
+; CHECK-LABEL: 'four_floats_four_shorts_vary_op'
+; CHECK: LV: Scalar loop costs: 28.
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 14 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 2: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: store ir<%conv14> to index 2
+; CHECK: store ir<%conv20> to index 3
+; CHECK: Cost for VF 2: 74 (Estimated cost per lane: 37)
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx>
+; CHECK: ir<%0> = load from index 0
+; CHECK: ir<%2> = load from index 1
+; CHECK: ir<%4> = load from index 2
+; CHECK: ir<%6> = load from index 3
+; CHECK: Cost of 36 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx1>
+; CHECK: ir<%1> = load from index 0
+; CHECK: ir<%3> = load from index 1
+; CHECK: ir<%5> = load from index 2
+; CHECK: ir<%7> = load from index 3
+; CHECK: Cost of 18 for VF 4: INTERLEAVE-GROUP with factor 4, ir<%arrayidx3>
+; CHECK: store ir<%conv> to index 0
+; CHECK: store ir<%conv8> to index 1
+; CHECK: store ir<%conv14> to index 2
+; CHECK: store ir<%conv20> to index 3
+; CHECK: Cost for VF 4: 118 (Estimated cost per lane: 29.5)
+; CHECK: LV: Selecting VF: 1.
+;
entry:
%cmp45.not = icmp eq i32 %N, 0
br i1 %cmp45.not, label %for.cond.cleanup, label %for.body
>From a91a9aaf32611c747ade75ab35eb01a2da5e5894 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Tue, 9 Jun 2026 14:21:43 +0000
Subject: [PATCH 2/4] Change print formatting of APFloat
We don't need that many decimal places!
---
.../Transforms/Vectorize/LoopVectorize.cpp | 5 +-
.../scalable-vectorization-cost-tuning.ll | 2 +-
.../LoopVectorize/ARM/mve-icmpcost.ll | 2 +-
.../ARM/mve-reg-pressure-spills.ll | 8 +--
.../WebAssembly/memory-interleave.ll | 66 +++++++++----------
5 files changed, 43 insertions(+), 40 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 90e4299d52e6b..4545e3aaa401b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5771,7 +5771,10 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
(void)CostPerLane.divide(EstimatedWidthAsAPFloat,
APFloat::rmNearestTiesToEven);
- LLVM_DEBUG(dbgs() << CostPerLane);
+
+ SmallString<16> Str;
+ CostPerLane.toString(Str, 3);
+ LLVM_DEBUG(dbgs() << Str);
} else /* No point dividing an invalid cost - it will still be invalid */
LLVM_DEBUG(dbgs() << "Invalid");
LLVM_DEBUG(dbgs() << ")\n");
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 86e560ee141fc..33b8f22bd048e 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
@@ -38,7 +38,7 @@ define void @test0(ptr %a, ptr %b, ptr %c) #0 {
; VSCALEFORTUNING2: Cost for VF vscale x 2: 10 (Estimated cost per lane: 2.5)
; VSCALEFORTUNING2: Cost for VF vscale x 4: 10 (Estimated cost per lane: 1.25)
; VSCALEFORTUNING2: Cost for VF vscale x 8: 10 (Estimated cost per lane: 0.625)
-; VSCALEFORTUNING2: Cost for VF vscale x 16: 10 (Estimated cost per lane: 0.3125)
+; VSCALEFORTUNING2: Cost for VF vscale x 16: 10 (Estimated cost per lane: 0.313)
; VSCALEFORTUNING2: LV: Selecting VF: vscale x 16.
;
; VSCALEFORTUNING1-PREFER-FIXED-LABEL: 'test0'
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
index e2c20107b14e9..e3273b563192f 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
@@ -395,7 +395,7 @@ define void @cheap_icmp(ptr nocapture readonly %pSrcA, ptr nocapture readonly %p
; CHECK: Cost of 0 for VF 16: vp<[[VP6]]> = DERIVED-IV ir<%pSrcB> + vp<[[VP2]]> * ir<1>
; CHECK: Cost of 1 for VF 16: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
; CHECK: Cost of 0 for VF 16: EMIT branch-on-cond vp<%cmp.n>
-; CHECK: Cost for VF 16: 50 (Estimated cost per lane: 3.125)
+; CHECK: Cost for VF 16: 50 (Estimated cost per lane: 3.13)
; CHECK: LV: Selecting VF: 16.
; CHECK: Cost of 1 for VF 16: EMIT vp<%cmp.n> = icmp eq ir<%blockSize>, vp<[[VP2]]>
; CHECK: Cost of 0 for VF 16: EMIT branch-on-cond vp<%cmp.n>
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
index d551cffb86f8b..3b0dfef583c15 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
@@ -172,13 +172,13 @@ exit:
; considering register pressure.
define void @spills_profitable(ptr %in1, ptr %in2, ptr %out, i32 %n, i32 %m) {
; CHECK-NOPRESSURE-LABEL: 'spills_profitable'
-; CHECK-NOPRESSURE: Cost for VF 2: 1535 (Estimated cost per lane: 767.5)
-; CHECK-NOPRESSURE: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK-NOPRESSURE: Cost for VF 2: 1535 (Estimated cost per lane: 768)
+; CHECK-NOPRESSURE: Cost for VF 4: 43 (Estimated cost per lane: 10.8)
; CHECK-NOPRESSURE: LV: Selecting VF: 4.
;
; CHECK-PRESSURE-LABEL: 'spills_profitable'
-; CHECK-PRESSURE: Cost for VF 2: 1539 (Estimated cost per lane: 769.5)
-; CHECK-PRESSURE: Cost for VF 4: 49 (Estimated cost per lane: 12.25)
+; CHECK-PRESSURE: Cost for VF 2: 1539 (Estimated cost per lane: 770)
+; CHECK-PRESSURE: Cost for VF 4: 49 (Estimated cost per lane: 12.3)
; CHECK-PRESSURE: LV: Selecting VF: 4.
;
entry:
diff --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
index 6141a59684f82..8a34d42ee48ec 100644
--- a/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
+++ b/llvm/test/Transforms/LoopVectorize/WebAssembly/memory-interleave.ll
@@ -145,7 +145,7 @@ define hidden void @three_ints(ptr noalias nocapture noundef writeonly %0, ptr n
; 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: 28.75)
+; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.8)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -204,7 +204,7 @@ define hidden void @three_shorts(ptr noalias nocapture noundef writeonly %0, ptr
; 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: 28.75)
+; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.8)
; 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>
@@ -214,7 +214,7 @@ define hidden void @three_shorts(ptr noalias nocapture noundef writeonly %0, ptr
; 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: 27.875)
+; CHECK: Cost for VF 8: 223 (Estimated cost per lane: 27.9)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -570,7 +570,7 @@ define hidden void @five_shorts(ptr noalias nocapture noundef writeonly %0, ptr
; CHECK: store ir<%25> to index 2
; CHECK: store ir<%31> to index 3
; CHECK: store ir<%37> to index 4
-; CHECK: Cost for VF 4: 135 (Estimated cost per lane: 33.75)
+; CHECK: Cost for VF 4: 135 (Estimated cost per lane: 33.8)
; CHECK: Cost of 84 for VF 8: INTERLEAVE-GROUP with factor 5, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -589,7 +589,7 @@ define hidden void @five_shorts(ptr noalias nocapture noundef writeonly %0, ptr
; CHECK: store ir<%25> to index 2
; CHECK: store ir<%31> to index 3
; CHECK: store ir<%37> to index 4
-; CHECK: Cost for VF 8: 261 (Estimated cost per lane: 32.625)
+; CHECK: Cost for VF 8: 261 (Estimated cost per lane: 32.6)
; CHECK: Cost of 168 for VF 16: INTERLEAVE-GROUP with factor 5, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -608,7 +608,7 @@ define hidden void @five_shorts(ptr noalias nocapture noundef writeonly %0, ptr
; CHECK: store ir<%25> to index 2
; CHECK: store ir<%31> to index 3
; CHECK: store ir<%37> to index 4
-; CHECK: Cost for VF 16: 513 (Estimated cost per lane: 32.0625)
+; CHECK: Cost for VF 16: 513 (Estimated cost per lane: 32.1)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -678,7 +678,7 @@ define hidden void @two_bytes_same_op(ptr noalias nocapture noundef writeonly %0
; CHECK: Cost of 11 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: 61 (Estimated cost per lane: 15.25)
+; CHECK: Cost for VF 4: 61 (Estimated cost per lane: 15.3)
; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -688,7 +688,7 @@ define hidden void @two_bytes_same_op(ptr noalias nocapture noundef writeonly %0
; CHECK: Cost of 7 for VF 8: 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 8: 33 (Estimated cost per lane: 4.125)
+; CHECK: Cost for VF 8: 33 (Estimated cost per lane: 4.13)
; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -698,7 +698,7 @@ define hidden void @two_bytes_same_op(ptr noalias nocapture noundef writeonly %0
; CHECK: Cost of 6 for VF 16: 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 16: 30 (Estimated cost per lane: 1.875)
+; CHECK: Cost for VF 16: 30 (Estimated cost per lane: 1.88)
; CHECK: LV: Selecting VF: 16.
;
%5 = icmp eq i32 %3, 0
@@ -767,7 +767,7 @@ define hidden void @two_bytes_vary_op(ptr noalias nocapture noundef writeonly %0
; CHECK: Cost of 6 for VF 16: 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 16: 27 (Estimated cost per lane: 1.6875)
+; CHECK: Cost for VF 16: 27 (Estimated cost per lane: 1.69)
; CHECK: LV: Selecting VF: 16.
;
%5 = icmp eq i32 %3, 0
@@ -819,7 +819,7 @@ define hidden void @three_bytes_same_op(ptr noalias nocapture noundef writeonly
; 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: 28.75)
+; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.8)
; 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>
@@ -829,7 +829,7 @@ define hidden void @three_bytes_same_op(ptr noalias nocapture noundef writeonly
; 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: 27.875)
+; CHECK: Cost for VF 8: 223 (Estimated cost per lane: 27.9)
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
@@ -839,7 +839,7 @@ define hidden void @three_bytes_same_op(ptr noalias nocapture noundef writeonly
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%22> = load ir<%21>
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%24> = load ir<%23>
; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%25>, ir<%26>
-; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4375)
+; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -898,7 +898,7 @@ define hidden void @three_bytes_interleave_op(ptr noalias nocapture noundef writ
; 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: 28.75)
+; CHECK: Cost for VF 4: 115 (Estimated cost per lane: 28.8)
; 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>
@@ -908,7 +908,7 @@ define hidden void @three_bytes_interleave_op(ptr noalias nocapture noundef writ
; 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: 27.875)
+; CHECK: Cost for VF 8: 223 (Estimated cost per lane: 27.9)
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%10> = load ir<%9>
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%12> = load ir<%11>
; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%13>, ir<%14>
@@ -918,7 +918,7 @@ define hidden void @three_bytes_interleave_op(ptr noalias nocapture noundef writ
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%22> = load ir<%21>
; CHECK: Cost of 48 for VF 16: REPLICATE ir<%24> = load ir<%23>
; CHECK: Cost of 48 for VF 16: REPLICATE store ir<%25>, ir<%26>
-; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4375)
+; CHECK: Cost for VF 16: 439 (Estimated cost per lane: 27.4)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -1002,7 +1002,7 @@ define hidden void @four_bytes_same_op(ptr noalias nocapture noundef writeonly %
; 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: 86 (Estimated cost per lane: 10.75)
+; CHECK: Cost for VF 8: 86 (Estimated cost per lane: 10.8)
; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -1018,7 +1018,7 @@ define hidden void @four_bytes_same_op(ptr noalias nocapture noundef writeonly %
; 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 16: 404 (Estimated cost per lane: 25.25)
+; CHECK: Cost for VF 16: 404 (Estimated cost per lane: 25.3)
; CHECK: LV: Selecting VF: 8.
;
%5 = icmp eq i32 %3, 0
@@ -1125,7 +1125,7 @@ define hidden void @four_bytes_split_op(ptr noalias nocapture noundef writeonly
; 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 16: 410 (Estimated cost per lane: 25.625)
+; CHECK: Cost for VF 16: 410 (Estimated cost per lane: 25.6)
; CHECK: LV: Selecting VF: 8.
;
%5 = icmp eq i32 %3, 0
@@ -1217,7 +1217,7 @@ define hidden void @four_bytes_interleave_op(ptr noalias nocapture noundef write
; 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: 86 (Estimated cost per lane: 10.75)
+; CHECK: Cost for VF 8: 86 (Estimated cost per lane: 10.8)
; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%9>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%16> = load from index 1
@@ -1233,7 +1233,7 @@ define hidden void @four_bytes_interleave_op(ptr noalias nocapture noundef write
; 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 16: 404 (Estimated cost per lane: 25.25)
+; CHECK: Cost for VF 16: 404 (Estimated cost per lane: 25.3)
; CHECK: LV: Selecting VF: 8.
;
%5 = icmp eq i32 %3, 0
@@ -1392,7 +1392,7 @@ define hidden void @eight_bytes_same_op(ptr noalias nocapture noundef writeonly
; CHECK: store ir<%43> to index 5
; CHECK: store ir<%49> to index 6
; CHECK: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 828 (Estimated cost per lane: 51.75)
+; CHECK: Cost for VF 16: 828 (Estimated cost per lane: 51.8)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -1578,7 +1578,7 @@ define hidden void @eight_bytes_split_op(ptr noalias nocapture noundef writeonly
; CHECK: store ir<%43> to index 5
; CHECK: store ir<%49> to index 6
; CHECK: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.25)
+; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.3)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -1764,7 +1764,7 @@ define hidden void @eight_bytes_interleave_op(ptr noalias nocapture noundef writ
; CHECK: store ir<%43> to index 5
; CHECK: store ir<%49> to index 6
; CHECK: store ir<%55> to index 7
-; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.25)
+; CHECK: Cost for VF 16: 804 (Estimated cost per lane: 50.3)
; CHECK: LV: Selecting VF: 1.
;
%5 = icmp eq i32 %3, 0
@@ -2037,14 +2037,14 @@ define hidden void @scale_uv_row_down2(ptr nocapture noundef readonly %0, i32 no
; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%11> to index 0
; CHECK: store ir<%13> to index 1
-; CHECK: Cost for VF 8: 41 (Estimated cost per lane: 5.125)
+; CHECK: Cost for VF 8: 41 (Estimated cost per lane: 5.13)
; CHECK: Cost of 68 for VF 16: INTERLEAVE-GROUP with factor 4, ir<%10>
; CHECK: ir<%11> = load from index 0
; CHECK: ir<%13> = load from index 1
; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%11> to index 0
; CHECK: store ir<%13> to index 1
-; CHECK: Cost for VF 16: 82 (Estimated cost per lane: 5.125)
+; CHECK: Cost for VF 16: 82 (Estimated cost per lane: 5.13)
; CHECK: LV: Selecting VF: 8.
;
%5 = icmp sgt i32 %3, 0
@@ -2098,7 +2098,7 @@ define hidden void @scale_uv_row_down2_box(ptr nocapture noundef readonly %0, i3
; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%30> to index 0
; CHECK: store ir<%48> to index 1
-; CHECK: Cost for VF 4: 75 (Estimated cost per lane: 18.75)
+; CHECK: Cost for VF 4: 75 (Estimated cost per lane: 18.8)
; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
; CHECK: ir<%14> = load from index 0
; CHECK: ir<%32> = load from index 1
@@ -2112,7 +2112,7 @@ define hidden void @scale_uv_row_down2_box(ptr nocapture noundef readonly %0, i3
; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%30> to index 0
; CHECK: store ir<%48> to index 1
-; CHECK: Cost for VF 8: 91 (Estimated cost per lane: 11.375)
+; CHECK: Cost for VF 8: 91 (Estimated cost per lane: 11.4)
; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
; CHECK: ir<%14> = load from index 0
; CHECK: ir<%32> = load from index 1
@@ -2126,7 +2126,7 @@ define hidden void @scale_uv_row_down2_box(ptr nocapture noundef readonly %0, i3
; CHECK: Cost of 6 for VF 16: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%30> to index 0
; CHECK: store ir<%48> to index 1
-; CHECK: Cost for VF 16: 324 (Estimated cost per lane: 20.25)
+; CHECK: Cost for VF 16: 324 (Estimated cost per lane: 20.3)
; CHECK: LV: Selecting VF: 8.
;
%5 = icmp sgt i32 %3, 0
@@ -2208,7 +2208,7 @@ define hidden void @scale_uv_row_down2_linear(ptr nocapture noundef readonly %0,
; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%18> to index 0
; CHECK: store ir<%28> to index 1
-; CHECK: Cost for VF 4: 49 (Estimated cost per lane: 12.25)
+; CHECK: Cost for VF 4: 49 (Estimated cost per lane: 12.3)
; CHECK: Cost of 26 for VF 8: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%20> = load from index 1
@@ -2217,7 +2217,7 @@ define hidden void @scale_uv_row_down2_linear(ptr nocapture noundef readonly %0,
; CHECK: Cost of 7 for VF 8: INTERLEAVE-GROUP with factor 2, vp<%next.gep>.1
; CHECK: store ir<%18> to index 0
; CHECK: store ir<%28> to index 1
-; CHECK: Cost for VF 8: 57 (Estimated cost per lane: 7.125)
+; CHECK: Cost for VF 8: 57 (Estimated cost per lane: 7.13)
; CHECK: Cost of 132 for VF 16: INTERLEAVE-GROUP with factor 4, vp<%next.gep>
; CHECK: ir<%10> = load from index 0
; CHECK: ir<%20> = load from index 1
@@ -2505,7 +2505,7 @@ define hidden void @two_floats_two_bytes_same_op(ptr noundef readonly captures(n
; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
; CHECK: store ir<%conv> to index 0
; CHECK: store ir<%conv9> to index 1
-; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.8)
; CHECK: LV: Selecting VF: 4.
;
entry:
@@ -2559,7 +2559,7 @@ define hidden void @two_floats_two_bytes_vary_op(ptr noundef readonly captures(n
; CHECK: Cost of 11 for VF 4: INTERLEAVE-GROUP with factor 2, ir<%arrayidx3>
; CHECK: store ir<%conv> to index 0
; CHECK: store ir<%conv8> to index 1
-; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.75)
+; CHECK: Cost for VF 4: 43 (Estimated cost per lane: 10.8)
; CHECK: LV: Selecting VF: 4.
;
entry:
>From 4362cb0cf6ddd0e816f186cad7faf3061de4fa9e Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Wed, 10 Jun 2026 08:31:52 +0000
Subject: [PATCH 3/4] Address review comment
---
.../Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
index 3b0dfef583c15..31473fcdcc69e 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --version 6
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --filter "Cost of .* from .* spills" --version 6
; REQUIRES: asserts
; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=false %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-NOPRESSURE
; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PRESSURE
@@ -16,7 +16,9 @@ define void @spills_not_profitable(ptr %in1, ptr %in2, ptr %out, i32 %n) {
; CHECK-NOPRESSURE: LV: Selecting VF: 4.
;
; CHECK-PRESSURE-LABEL: 'spills_not_profitable'
+; CHECK-PRESSURE: LV(REG): Cost of 50 from 25 spills of Generic::VectorRC
; CHECK-PRESSURE: Cost for VF 2: 444 (Estimated cost per lane: 222)
+; CHECK-PRESSURE: LV(REG): Cost of 50 from 25 spills of Generic::VectorRC
; CHECK-PRESSURE: Cost for VF 4: 388 (Estimated cost per lane: 97)
; CHECK-PRESSURE: LV: Selecting VF: 1.
;
@@ -177,7 +179,9 @@ define void @spills_profitable(ptr %in1, ptr %in2, ptr %out, i32 %n, i32 %m) {
; CHECK-NOPRESSURE: LV: Selecting VF: 4.
;
; CHECK-PRESSURE-LABEL: 'spills_profitable'
+; CHECK-PRESSURE: LV(REG): Cost of 4 from 2 spills of Generic::ScalarRC
; CHECK-PRESSURE: Cost for VF 2: 1539 (Estimated cost per lane: 770)
+; CHECK-PRESSURE: LV(REG): Cost of 6 from 3 spills of Generic::VectorRC
; CHECK-PRESSURE: Cost for VF 4: 49 (Estimated cost per lane: 12.3)
; CHECK-PRESSURE: LV: Selecting VF: 4.
;
>From cfc70927ab15465c47cb8ed1003a474e3cf6cf34 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Thu, 11 Jun 2026 12:13:51 +0000
Subject: [PATCH 4/4] Address review comments
---
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 14 +++++++-------
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 5 +++--
.../LoopVectorize/ARM/mve-reg-pressure-spills.ll | 8 +++-----
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 4545e3aaa401b..f3ad80e72b0ce 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5764,13 +5764,13 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan, ElementCount VF,
LLVM_DEBUG(dbgs() << "Cost for VF " << VF << ": " << Cost
<< " (Estimated cost per lane: ");
if (Cost.isValid()) {
- APFloat CostPerLane(APFloat::IEEEdouble(),
- APInt(64, (uint64_t)Cost.getValue()));
- APFloat EstimatedWidthAsAPFloat(APFloat::IEEEdouble(),
- APInt(64, (uint64_t)EstimatedWidth));
-
- (void)CostPerLane.divide(EstimatedWidthAsAPFloat,
- APFloat::rmNearestTiesToEven);
+ APFloat CostPerLane(APFloat::IEEEdouble());
+ APFloat EstimatedWidthAsAPFloat(APFloat::IEEEdouble());
+ (void)CostPerLane.convertFromAPInt(APInt(64, (uint64_t)Cost.getValue()),
+ false, APFloat::rmTowardZero);
+ (void)EstimatedWidthAsAPFloat.convertFromAPInt(
+ APInt(64, (uint64_t)EstimatedWidth), false, APFloat::rmTowardZero);
+ (void)CostPerLane.divide(EstimatedWidthAsAPFloat, APFloat::rmTowardZero);
SmallString<16> Str;
CostPerLane.toString(Str, 3);
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 31b511c359a69..63d782fb93216 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -47,9 +47,10 @@ using VectorParts = SmallVector<Value *, 2>;
#define LV_NAME "loop-vectorize"
#define DEBUG_TYPE LV_NAME
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
// It is sometimes necessary to disable printing of metadata in tests in order
-// to avoid non-deterministic behaviour.
+// to avoid non-deterministic behaviour due to metadata introduced by VPlan
+// that wasn't present in the original scalar IR.
static cl::opt<bool> VPlanPrintMetadata(
"vplan-print-metadata", cl::init(true), cl::Hidden,
cl::desc("Controls the printing of recipe metadata when debugging."));
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
index 31473fcdcc69e..b725da314350e 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/mve-reg-pressure-spills.ll
@@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost for VF" --filter "LV: Selecting VF" --filter "Cost of .* from .* spills" --version 6
; REQUIRES: asserts
-; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=false %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-NOPRESSURE
-; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PRESSURE
-; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PRESSURE
+; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=false %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NOPRESSURE
+; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each -vectorizer-consider-reg-pressure=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK-PRESSURE
+; RUN: opt -mcpu=cortex-m55 -passes=loop-vectorize -disable-output -debug-only=loop-vectorize,vplan -vplan-verify-each %s 2>&1 | FileCheck %s --check-prefixes=CHECK-PRESSURE
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv8.1m.main-unknown-none-eabihf"
@@ -272,5 +272,3 @@ exit:
store i64 %acc3.exit, ptr %arrayidx45, align 8
ret void
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CHECK: {{.*}}
More information about the llvm-commits
mailing list