[llvm-branch-commits] [llvm] a6d825f - [NFC][WebAssembly] Precommit tests (#234647)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Oct 22 09:48:00 PDT 2026


Author: Sam Parker
Date: 2026-10-22T15:53:13Z
New Revision: a6d825fa562974d9e0daf32b1a2d1e53f021202f

URL: https://github.com/llvm/llvm-project/commit/a6d825fa562974d9e0daf32b1a2d1e53f021202f
DIFF: https://github.com/llvm/llvm-project/commit/a6d825fa562974d9e0daf32b1a2d1e53f021202f.diff

LOG: [NFC][WebAssembly] Precommit tests (#234647)

Cost model tests for the loop vectorizer.

Added: 
    llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/luma_dominant.ll
    llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/variance-8x16.ll

Modified: 
    llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll
index 6474d03605d46..3b2bf086d99c4 100644
--- a/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/int-mac-reduction-costs.ll
@@ -903,3 +903,221 @@ for.body:
   %exitcond.not = icmp eq i32 %inc, %N
   br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
 }
+
+define hidden i64 @i64_mac_u8_u8(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, i32 noundef %N) {
+; CHECK-LABEL: 'i64_mac_u8_u8'
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%add>
+; CHECK:  Cost of 3 for VF 2: WIDEN ir<%0> = load vp<[[VP6:%[0-9]+]]>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; CHECK:  Cost of 3 for VF 2: WIDEN ir<%1> = load vp<[[VP7:%[0-9]+]]>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nuw nsw ir<%conv2>, ir<%conv>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%conv3> = zext nneg ir<%mul> to i64
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; CHECK:  Cost for VF 2: 13 (Estimated cost per lane: 6.5)
+; CHECK:  LV: Selecting VF: 2.
+;
+; MAX-LABEL: 'i64_mac_u8_u8'
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%add>
+; MAX:  Cost of 3 for VF 2: WIDEN ir<%0> = load vp<[[VP6:%[0-9]+]]>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 3 for VF 2: WIDEN ir<%1> = load vp<[[VP7:%[0-9]+]]>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nuw nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%conv3> = zext nneg ir<%mul> to i64
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 2: 13 (Estimated cost per lane: 6.5)
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul> = mul nuw nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv3> = zext nneg ir<%mul> to i64
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 4: 15 (Estimated cost per lane: 3.75)
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%mul> = mul nuw nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 4 for VF 8: WIDEN-CAST ir<%conv3> = zext nneg ir<%mul> to i64
+; MAX:  Cost of 4 for VF 8: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 8: 24 (Estimated cost per lane: 3)
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%mul> = mul nuw nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 8 for VF 16: WIDEN-CAST ir<%conv3> = zext nneg ir<%mul> to i64
+; MAX:  Cost of 8 for VF 16: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 16: 40 (Estimated cost per lane: 2.5)
+; MAX:  LV: Selecting VF: 16.
+;
+entry:
+  %cmp7.not = icmp eq i32 %N, 0
+  br i1 %cmp7.not, label %for.cond.cleanup, label %for.body
+
+for.cond.cleanup:
+  %res.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
+  ret i64 %res.0.lcssa
+
+for.body:
+  %i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
+  %res.08 = phi i64 [ %add, %for.body ], [ 0, %entry ]
+  %arrayidx = getelementptr inbounds nuw i8, ptr %a, i32 %i.09
+  %0 = load i8, ptr %arrayidx, align 1
+  %conv = zext i8 %0 to i32
+  %arrayidx1 = getelementptr inbounds nuw i8, ptr %b, i32 %i.09
+  %1 = load i8, ptr %arrayidx1, align 1
+  %conv2 = zext i8 %1 to i32
+  %mul = mul nuw nsw i32 %conv2, %conv
+  %conv3 = zext nneg i32 %mul to i64
+  %add = add nsw i64 %conv3, %res.08
+  %inc = add nuw i32 %i.09, 1
+  %exitcond.not = icmp eq i32 %inc, %N
+  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
+}
+
+define hidden i64 @i64_mac_s8_s8(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, i32 noundef %N) {
+; CHECK-LABEL: 'i64_mac_s8_s8'
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%add>
+; CHECK:  Cost of 3 for VF 2: WIDEN ir<%0> = load vp<[[VP6:%[0-9]+]]>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = sext ir<%0> to i32
+; CHECK:  Cost of 3 for VF 2: WIDEN ir<%1> = load vp<[[VP7:%[0-9]+]]>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = sext ir<%1> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nsw ir<%conv2>, ir<%conv>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%conv3> = sext ir<%mul> to i64
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; CHECK:  Cost for VF 2: 13 (Estimated cost per lane: 6.5)
+; CHECK:  LV: Selecting VF: 2.
+;
+; MAX-LABEL: 'i64_mac_s8_s8'
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%add>
+; MAX:  Cost of 3 for VF 2: WIDEN ir<%0> = load vp<[[VP6:%[0-9]+]]>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = sext ir<%0> to i32
+; MAX:  Cost of 3 for VF 2: WIDEN ir<%1> = load vp<[[VP7:%[0-9]+]]>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = sext ir<%1> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%conv3> = sext ir<%mul> to i64
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 2: 13 (Estimated cost per lane: 6.5)
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%conv> = sext ir<%0> to i32
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%conv2> = sext ir<%1> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul> = mul nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv3> = sext ir<%mul> to i64
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 4: 15 (Estimated cost per lane: 3.75)
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%conv> = sext ir<%0> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%conv2> = sext ir<%1> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%mul> = mul nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 4 for VF 8: WIDEN-CAST ir<%conv3> = sext ir<%mul> to i64
+; MAX:  Cost of 4 for VF 8: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 8: 24 (Estimated cost per lane: 3)
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%res.08> = phi (add) vp<[[VP3]]>, ir<%add>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%0> = load vp<[[VP6]]>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv> = sext ir<%0> to i32
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%1> = load vp<[[VP7]]>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv2> = sext ir<%1> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%mul> = mul nsw ir<%conv2>, ir<%conv>
+; MAX:  Cost of 8 for VF 16: WIDEN-CAST ir<%conv3> = sext ir<%mul> to i64
+; MAX:  Cost of 8 for VF 16: WIDEN ir<%add> = add ir<%conv3>, ir<%res.08>
+; MAX:  Cost for VF 16: 40 (Estimated cost per lane: 2.5)
+; MAX:  LV: Selecting VF: 16.
+;
+entry:
+  %cmp7.not = icmp eq i32 %N, 0
+  br i1 %cmp7.not, label %for.cond.cleanup, label %for.body
+
+for.cond.cleanup:
+  %res.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
+  ret i64 %res.0.lcssa
+
+for.body:
+  %i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
+  %res.08 = phi i64 [ %add, %for.body ], [ 0, %entry ]
+  %arrayidx = getelementptr inbounds nuw i8, ptr %a, i32 %i.09
+  %0 = load i8, ptr %arrayidx, align 1
+  %conv = sext i8 %0 to i32
+  %arrayidx1 = getelementptr inbounds nuw i8, ptr %b, i32 %i.09
+  %1 = load i8, ptr %arrayidx1, align 1
+  %conv2 = sext i8 %1 to i32
+  %mul = mul nsw i32 %conv2, %conv
+  %conv3 = sext i32 %mul to i64
+  %add = add nsw i64 %conv3, %res.08
+  %inc = add nuw i32 %i.09, 1
+  %exitcond.not = icmp eq i32 %inc, %N
+  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
+}
+
+define hidden i64 @u64_mac_u8(ptr noundef readonly captures(none) %arg, i32 noundef %arg1) {
+; CHECK-LABEL: 'u64_mac_u8'
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%i6> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%i12>
+; CHECK:  Cost of 3 for VF 2: WIDEN ir<%i8> = load vp<[[VP6:%[0-9]+]]>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%i9> = zext ir<%i8> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%i10> = mul nuw nsw ir<%i9>, ir<%i9>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%i11> = zext nneg ir<%i10> to i64
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%i12> = add ir<%i6>, ir<%i11>
+; CHECK:  Cost for VF 2: 10 (Estimated cost per lane: 5)
+; CHECK:  LV: Selecting VF: 2.
+;
+; MAX-LABEL: 'u64_mac_u8'
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%i6> = phi (add) vp<[[VP3:%[0-9]+]]>, ir<%i12>
+; MAX:  Cost of 3 for VF 2: WIDEN ir<%i8> = load vp<[[VP6:%[0-9]+]]>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%i9> = zext ir<%i8> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%i10> = mul nuw nsw ir<%i9>, ir<%i9>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%i11> = zext nneg ir<%i10> to i64
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%i12> = add ir<%i6>, ir<%i11>
+; MAX:  Cost for VF 2: 10 (Estimated cost per lane: 5)
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%i6> = phi (add) vp<[[VP3]]>, ir<%i12>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%i8> = load vp<[[VP6]]>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%i9> = zext ir<%i8> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%i10> = mul nuw nsw ir<%i9>, ir<%i9>
+; MAX:  Cost of 2 for VF 4: WIDEN-CAST ir<%i11> = zext nneg ir<%i10> to i64
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%i12> = add ir<%i6>, ir<%i11>
+; MAX:  Cost for VF 4: 12 (Estimated cost per lane: 3)
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%i6> = phi (add) vp<[[VP3]]>, ir<%i12>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%i8> = load vp<[[VP6]]>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%i9> = zext ir<%i8> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%i10> = mul nuw nsw ir<%i9>, ir<%i9>
+; MAX:  Cost of 4 for VF 8: WIDEN-CAST ir<%i11> = zext nneg ir<%i10> to i64
+; MAX:  Cost of 4 for VF 8: WIDEN ir<%i12> = add ir<%i6>, ir<%i11>
+; MAX:  Cost for VF 8: 19 (Estimated cost per lane: 2.38)
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%i6> = phi (add) vp<[[VP3]]>, ir<%i12>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%i8> = load vp<[[VP6]]>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%i9> = zext ir<%i8> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%i10> = mul nuw nsw ir<%i9>, ir<%i9>
+; MAX:  Cost of 8 for VF 16: WIDEN-CAST ir<%i11> = zext nneg ir<%i10> to i64
+; MAX:  Cost of 8 for VF 16: WIDEN ir<%i12> = add ir<%i6>, ir<%i11>
+; MAX:  Cost for VF 16: 32 (Estimated cost per lane: 2)
+; MAX:  LV: Selecting VF: 16.
+;
+bb:
+  %i = icmp eq i32 %arg1, 0
+  br i1 %i, label %bb2, label %bb4
+
+bb2:
+  %i3 = phi i64 [ 0, %bb ], [ %i12, %bb4 ]
+  ret i64 %i3
+
+bb4:
+  %i5 = phi i32 [ %i13, %bb4 ], [ 0, %bb ]
+  %i6 = phi i64 [ %i12, %bb4 ], [ 0, %bb ]
+  %i7 = getelementptr inbounds nuw i8, ptr %arg, i32 %i5
+  %i8 = load i8, ptr %i7, align 1
+  %i9 = zext i8 %i8 to i32
+  %i10 = mul nuw nsw i32 %i9, %i9
+  %i11 = zext nneg i32 %i10 to i64
+  %i12 = add i64 %i6, %i11
+  %i13 = add nuw i32 %i5, 1
+  %i14 = icmp eq i32 %i13, %arg1
+  br i1 %i14, label %bb2, label %bb4
+}

diff  --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/luma_dominant.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/luma_dominant.ll
new file mode 100644
index 0000000000000..715e1315db0ed
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/luma_dominant.ll
@@ -0,0 +1,279 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost of [0-9]+(.[0-9]+)? for VF [0-9]+: (INTERLEAVE-GROUP with factor [0-9]+,|EXPRESSION|REPLICATE|WIDEN)" --filter "LV: Selecting VF:" --filter "Estimated cost per lane" --version 6
+; REQUIRES: asserts
+; RUN: opt -mtriple=wasm32 -mattr=+simd128 -passes=loop-vectorize -debug-only=loop-vectorize -disable-output -S < %s 2>&1 | FileCheck %s
+; RUN: opt -mtriple=wasm32 -mattr=+simd128 -passes=loop-vectorize -vectorizer-maximize-bandwidth -debug-only=loop-vectorize -disable-output -S < %s 2>&1 | FileCheck %s --check-prefix=MAX
+
+; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite)
+define hidden void @luma_dominant(ptr noundef readonly captures(none) %ub, ptr noundef readonly captures(none) %vb, i32 noundef %uv_w, ptr noundef writeonly captures(none) %counts) {
+; CHECK-LABEL: 'luma_dominant'
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5:%[0-9]+]]>, ir<%spec.select>
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; CHECK:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; CHECK:  Cost of 0 for VF 2: REPLICATE ir<%arrayidx> = getelementptr inbounds nuw ir<%ub>, vp<[[VP8:%[0-9]+]]>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; CHECK:  Cost of 0 for VF 2: REPLICATE ir<%arrayidx1> = getelementptr inbounds nuw ir<%vb>, vp<[[VP8]]>
+; CHECK:  Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; CHECK:  Cost of 1 for VF 2: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; CHECK:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; CHECK:  Cost for VF 2: 46 (Estimated cost per lane: 23)
+; CHECK:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5]]>, ir<%spec.select>
+; CHECK:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; CHECK:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; CHECK:  Cost of 10 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; CHECK:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; CHECK:  Cost of 10 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx1>
+; CHECK:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; CHECK:  Cost of 1 for VF 4: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; CHECK:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; CHECK:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; CHECK:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; CHECK:  Cost for VF 4: 57 (Estimated cost per lane: 14.3)
+; CHECK:  LV: Selecting VF: 4.
+;
+; MAX-LABEL: 'luma_dominant'
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5:%[0-9]+]]>, ir<%spec.select>
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; MAX:  Cost of 1 for VF 2: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; MAX:  Cost of 0 for VF 2: REPLICATE ir<%arrayidx> = getelementptr inbounds nuw ir<%ub>, vp<[[VP8:%[0-9]+]]>
+; MAX:  Cost of 6 for VF 2: REPLICATE ir<%0> = load ir<%arrayidx>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; MAX:  Cost of 0 for VF 2: REPLICATE ir<%arrayidx1> = getelementptr inbounds nuw ir<%vb>, vp<[[VP8]]>
+; MAX:  Cost of 6 for VF 2: REPLICATE ir<%1> = load ir<%arrayidx1>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; MAX:  Cost of 1 for VF 2: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; MAX:  Cost of 1 for VF 2: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; MAX:  Cost for VF 2: 46 (Estimated cost per lane: 23)
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5]]>, ir<%spec.select>
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; MAX:  Cost of 1 for VF 4: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; MAX:  Cost of 10 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; MAX:  Cost of 10 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx1>
+; MAX:  Cost of 2 for VF 4: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; MAX:  Cost of 1 for VF 4: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; MAX:  Cost of 1 for VF 4: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; MAX:  Cost for VF 4: 57 (Estimated cost per lane: 14.3)
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5]]>, ir<%spec.select>
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; MAX:  Cost of 1 for VF 8: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; MAX:  Cost of 20 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 5 for VF 8: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; MAX:  Cost of 20 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx1>
+; MAX:  Cost of 5 for VF 8: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; MAX:  Cost of 4 for VF 8: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; MAX:  Cost of 3 for VF 8: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; MAX:  Cost for VF 8: 122 (Estimated cost per lane: 15.3)
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%core_cnt.078> = phi (add) vp<[[VP5]]>, ir<%spec.select>
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%tail_cnt.077> = phi (add) vp<[[VP5]]>, ir<%tail_cnt.1>
+; MAX:  Cost of 1 for VF 16: WIDEN-REDUCTION-PHI ir<%neutral_cnt.076> = phi (add) vp<[[VP5]]>, ir<%neutral_cnt.1>
+; MAX:  Cost of 40 for VF 16: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv> = zext ir<%0> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%sub> = add nsw ir<%conv>, ir<-128>
+; MAX:  Cost of 40 for VF 16: INTERLEAVE-GROUP with factor 8, ir<%arrayidx1>
+; MAX:  Cost of 6 for VF 16: WIDEN-CAST ir<%conv2> = zext ir<%1> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%sub3> = add nsw ir<%conv2>, ir<-128>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%sub8> = sub nsw ir<%conv>, ir<%conv2>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%mul> = mul nsw ir<%sub>, ir<%sub>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%mul9> = mul nsw ir<%sub3>, ir<%sub3>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%add> = add nuw nsw ir<%mul9>, ir<%mul>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%sub12> = sub nsw ir<128>, ir<%conv>
+; MAX:  Cost of 1 for VF 16: WIDEN ir<%cmp1072> = icmp slt ir<%0>, ir<0>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cond> = select ir<%cmp1072>, ir<%sub>, ir<%sub12>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%sub16> = sub nsw ir<128>, ir<%conv2>
+; MAX:  Cost of 1 for VF 16: WIDEN ir<%cmp1373> = icmp slt ir<%1>, ir<0>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cond19> = select ir<%cmp1373>, ir<%sub3>, ir<%sub16>
+; MAX:  Cost of 8 for VF 16: WIDEN-INTRINSIC ir<%cond26> = call llvm.abs(ir<%sub8>, ir<true>)
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cmp27> = icmp ult ir<%add>, ir<257>
+; MAX:  Cost of 7 for VF 16: WIDEN-CAST ir<%inc> = zext ir<%cmp27> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%spec.select> = add ir<%core_cnt.078>, ir<%inc>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cmp29> = icmp ult ir<%add>, ir<325>
+; MAX:  Cost of 7 for VF 16: WIDEN-CAST ir<%inc32> = zext ir<%cmp29> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%tail_cnt.1> = add ir<%tail_cnt.077>, ir<%inc32>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cmp34> = icmp slt ir<%cond>, ir<7>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cmp36> = icmp slt ir<%cond19>, ir<7>
+; MAX:  Cost of 1 for VF 16: WIDEN ir<%or.cond> = select ir<%cmp34>, ir<%cmp36>, ir<false>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%cmp39> = icmp ult ir<%cond26>, ir<5>
+; MAX:  Cost of 1 for VF 16: WIDEN ir<%or.cond48> = select ir<%or.cond>, ir<%cmp39>, ir<false>
+; MAX:  Cost of 7 for VF 16: WIDEN-CAST ir<%inc42> = zext ir<%or.cond48> to i32
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%neutral_cnt.1> = add ir<%neutral_cnt.076>, ir<%inc42>
+; MAX:  Cost for VF 16: 256 (Estimated cost per lane: 16)
+; MAX:  LV: Selecting VF: 4.
+;
+entry:
+  %cmp74.not = icmp eq i32 %uv_w, 0
+  br i1 %cmp74.not, label %for.cond.cleanup, label %for.body
+
+for.cond.cleanup:                                 ; preds = %for.body, %entry
+  %neutral_cnt.0.lcssa = phi i32 [ 0, %entry ], [ %neutral_cnt.1, %for.body ]
+  %tail_cnt.0.lcssa = phi i32 [ 0, %entry ], [ %tail_cnt.1, %for.body ]
+  %core_cnt.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ]
+  store i32 %core_cnt.0.lcssa, ptr %counts, align 4
+  %arrayidx46 = getelementptr inbounds nuw i8, ptr %counts, i32 4
+  store i32 %tail_cnt.0.lcssa, ptr %arrayidx46, align 4
+  %arrayidx47 = getelementptr inbounds nuw i8, ptr %counts, i32 8
+  store i32 %neutral_cnt.0.lcssa, ptr %arrayidx47, align 4
+  ret void
+
+for.body:                                         ; preds = %entry, %for.body
+  %core_cnt.078 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
+  %tail_cnt.077 = phi i32 [ %tail_cnt.1, %for.body ], [ 0, %entry ]
+  %neutral_cnt.076 = phi i32 [ %neutral_cnt.1, %for.body ], [ 0, %entry ]
+  %x.075 = phi i32 [ %add44, %for.body ], [ 0, %entry ]
+  %arrayidx = getelementptr inbounds nuw i8, ptr %ub, i32 %x.075
+  %0 = load i8, ptr %arrayidx, align 1
+  %conv = zext i8 %0 to i32
+  %sub = add nsw i32 %conv, -128
+  %arrayidx1 = getelementptr inbounds nuw i8, ptr %vb, i32 %x.075
+  %1 = load i8, ptr %arrayidx1, align 1
+  %conv2 = zext i8 %1 to i32
+  %sub3 = add nsw i32 %conv2, -128
+  %sub8 = sub nsw i32 %conv, %conv2
+  %mul = mul nsw i32 %sub, %sub
+  %mul9 = mul nsw i32 %sub3, %sub3
+  %add = add nuw nsw i32 %mul9, %mul
+  %sub12 = sub nsw i32 128, %conv
+  %cmp1072 = icmp slt i8 %0, 0
+  %cond = select i1 %cmp1072, i32 %sub, i32 %sub12
+  %sub16 = sub nsw i32 128, %conv2
+  %cmp1373 = icmp slt i8 %1, 0
+  %cond19 = select i1 %cmp1373, i32 %sub3, i32 %sub16
+  %cond26 = tail call i32 @llvm.abs.i32(i32 %sub8, i1 true)
+  %cmp27 = icmp samesign ult i32 %add, 257
+  %inc = zext i1 %cmp27 to i32
+  %spec.select = add i32 %core_cnt.078, %inc
+  %cmp29 = icmp samesign ult i32 %add, 325
+  %inc32 = zext i1 %cmp29 to i32
+  %tail_cnt.1 = add i32 %tail_cnt.077, %inc32
+  %cmp34 = icmp slt i32 %cond, 7
+  %cmp36 = icmp slt i32 %cond19, 7
+  %or.cond = select i1 %cmp34, i1 %cmp36, i1 false
+  %cmp39 = icmp samesign ult i32 %cond26, 5
+  %or.cond48 = select i1 %or.cond, i1 %cmp39, i1 false
+  %inc42 = zext i1 %or.cond48 to i32
+  %neutral_cnt.1 = add i32 %neutral_cnt.076, %inc42
+  %add44 = add nuw i32 %x.075, 8
+  %cmp = icmp ult i32 %add44, %uv_w
+  br i1 %cmp, label %for.body, label %for.cond.cleanup
+}
+
+declare i32 @llvm.abs.i32(i32, i1 immarg)

diff  --git a/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/variance-8x16.ll b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/variance-8x16.ll
new file mode 100644
index 0000000000000..1e068f9194894
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/WebAssembly/CostModel/variance-8x16.ll
@@ -0,0 +1,638 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost of [0-9]+(.[0-9]+)? for VF [0-9]+: (INTERLEAVE-GROUP with factor [0-9]+,|EXPRESSION|REPLICATE|WIDEN)" --filter "LV: Selecting VF:" --filter "Estimated cost per lane" --version 6
+; REQUIRES: asserts
+; RUN: opt -mtriple=wasm32 -mattr=+simd128 -passes=loop-vectorize -debug-only=loop-vectorize -disable-output -S < %s 2>&1 | FileCheck %s
+; RUN: opt -mtriple=wasm32 -mattr=+simd128 -passes=loop-vectorize -vectorizer-maximize-bandwidth -debug-only=loop-vectorize -disable-output -S < %s 2>&1 | FileCheck %s --check-prefix=MAX
+
+define hidden void @variance_8x16(ptr noundef readonly captures(none) %a, ptr noundef writeonly captures(none) %b, ptr noundef readonly captures(none) %filter) {
+; CHECK-LABEL: 'variance_8x16'
+; CHECK:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; CHECK:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; CHECK:  Cost of 1 for VF 2: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; CHECK:  Cost of 2 for VF 2: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; CHECK:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; CHECK:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; CHECK:  Cost for VF 2: 156 (Estimated cost per lane: 78)
+; CHECK:  Cost of 68 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; CHECK:  Cost of 68 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; CHECK:  Cost of 1 for VF 4: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; CHECK:  Cost of 2 for VF 4: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; CHECK:  Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; CHECK:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; CHECK:  Cost for VF 4: 256 (Estimated cost per lane: 64)
+; CHECK:  Cost of 136 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; CHECK:  Cost of 136 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; CHECK:  Cost of 1 for VF 8: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; CHECK:  Cost of 2 for VF 8: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; CHECK:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; CHECK:  Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; CHECK:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; CHECK:  Cost for VF 8: 474 (Estimated cost per lane: 59.3)
+; CHECK:  LV: Selecting VF: 8.
+;
+; MAX-LABEL: 'variance_8x16'
+; MAX:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; MAX:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; MAX:  Cost of 1 for VF 2: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; MAX:  Cost of 2 for VF 2: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; MAX:  Cost of 34 for VF 2: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; MAX:  Cost of 0 for VF 2: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; MAX:  Cost for VF 2: 156 (Estimated cost per lane: 78)
+; MAX:  Cost of 68 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; MAX:  Cost of 68 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; MAX:  Cost of 1 for VF 4: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; MAX:  Cost of 2 for VF 4: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; MAX:  Cost of 66 for VF 4: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; MAX:  Cost of 0 for VF 4: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; MAX:  Cost for VF 4: 256 (Estimated cost per lane: 64)
+; MAX:  Cost of 136 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; MAX:  Cost of 136 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; MAX:  Cost of 1 for VF 8: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; MAX:  Cost of 2 for VF 8: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; MAX:  Cost of 2 for VF 8: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; MAX:  Cost of 132 for VF 8: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; MAX:  Cost of 0 for VF 8: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; MAX:  Cost for VF 8: 474 (Estimated cost per lane: 59.3)
+; MAX:  Cost of 272 for VF 16: INTERLEAVE-GROUP with factor 8, ir<%arrayidx>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul3> = mul ir<%0>, ir<%conv2>
+; MAX:  Cost of 272 for VF 16: INTERLEAVE-GROUP with factor 8, ir<%arrayidx7>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul11> = mul ir<%2>, ir<%conv10>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add12> = add ir<%mul3>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add13> = add ir<%add12>, ir<%mul11>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr> = lshr ir<%add13>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv14> = trunc ir<%shr> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul24> = mul ir<%4>, ir<%conv23>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul32> = mul ir<%6>, ir<%conv31>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add33> = add ir<%mul24>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add34> = add ir<%add33>, ir<%mul32>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr35> = lshr ir<%add34>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv36> = trunc ir<%shr35> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul46> = mul ir<%8>, ir<%conv45>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul54> = mul ir<%10>, ir<%conv53>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add55> = add ir<%mul46>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add56> = add ir<%add55>, ir<%mul54>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr57> = lshr ir<%add56>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv58> = trunc ir<%shr57> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul68> = mul ir<%12>, ir<%conv67>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul76> = mul ir<%14>, ir<%conv75>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add77> = add ir<%mul68>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add78> = add ir<%add77>, ir<%mul76>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr79> = lshr ir<%add78>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv80> = trunc ir<%shr79> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul90> = mul ir<%16>, ir<%conv89>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul98> = mul ir<%18>, ir<%conv97>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add99> = add ir<%mul90>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add100> = add ir<%add99>, ir<%mul98>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr101> = lshr ir<%add100>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv102> = trunc ir<%shr101> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul112> = mul ir<%20>, ir<%conv111>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul120> = mul ir<%22>, ir<%conv119>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add121> = add ir<%mul112>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add122> = add ir<%add121>, ir<%mul120>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr123> = lshr ir<%add122>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv124> = trunc ir<%shr123> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul134> = mul ir<%24>, ir<%conv133>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul142> = mul ir<%26>, ir<%conv141>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add143> = add ir<%mul134>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add144> = add ir<%add143>, ir<%mul142>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr145> = lshr ir<%add144>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv146> = trunc ir<%shr145> to i8
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul156> = mul ir<%28>, ir<%conv155>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%mul164> = mul ir<%30>, ir<%conv163>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add165> = add ir<%mul156>, ir<64>
+; MAX:  Cost of 2 for VF 16: WIDEN ir<%add166> = add ir<%add165>, ir<%mul164>
+; MAX:  Cost of 4 for VF 16: WIDEN ir<%shr167> = lshr ir<%add166>, ir<7>
+; MAX:  Cost of 3 for VF 16: WIDEN-CAST ir<%conv168> = trunc ir<%shr167> to i8
+; MAX:  Cost of 264 for VF 16: INTERLEAVE-GROUP with factor 8, ir<%arrayidx17>
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv2> = zext ir<%1> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv10> = zext ir<%3> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv23> = zext ir<%5> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv31> = zext ir<%7> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv45> = zext ir<%9> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv53> = zext ir<%11> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv67> = zext ir<%13> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv75> = zext ir<%15> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv89> = zext ir<%17> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv97> = zext ir<%19> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv111> = zext ir<%21> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv119> = zext ir<%23> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv133> = zext ir<%25> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv141> = zext ir<%27> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv155> = zext ir<%29> to i16
+; MAX:  Cost of 2 for VF 16: WIDEN-CAST ir<%conv163> = zext ir<%31> to i16
+; MAX:  Cost for VF 16: 964 (Estimated cost per lane: 60.3)
+; MAX:  LV: Selecting VF: 8.
+;
+entry:
+  %arrayidx9 = getelementptr inbounds nuw i8, ptr %filter, i32 1
+  br label %for.body
+
+for.cond.cleanup:                                 ; preds = %for.body
+  ret void
+
+for.body:                                         ; preds = %entry, %for.body
+  %i.0234 = phi i32 [ 0, %entry ], [ %add4, %for.body ]
+  %mul = shl nuw nsw i32 %i.0234, 3
+  %arrayidx = getelementptr inbounds nuw i16, ptr %a, i32 %mul
+  %0 = load i16, ptr %arrayidx, align 2
+  %1 = load i8, ptr %filter, align 1
+  %conv2 = zext i8 %1 to i16
+  %mul3 = mul i16 %0, %conv2
+  %add4 = add nuw nsw i32 %i.0234, 1
+  %arrayidx7.idx = shl nuw nsw i32 %add4, 4
+  %arrayidx7 = getelementptr inbounds nuw i8, ptr %a, i32 %arrayidx7.idx
+  %2 = load i16, ptr %arrayidx7, align 2
+  %3 = load i8, ptr %arrayidx9, align 1
+  %conv10 = zext i8 %3 to i16
+  %mul11 = mul i16 %2, %conv10
+  %add12 = add i16 %mul3, 64
+  %add13 = add i16 %add12, %mul11
+  %shr = lshr i16 %add13, 7
+  %conv14 = trunc i16 %shr to i8
+  %arrayidx17 = getelementptr inbounds nuw i8, ptr %b, i32 %mul
+  store i8 %conv14, ptr %arrayidx17, align 1
+  %add19 = or disjoint i32 %mul, 1
+  %arrayidx20 = getelementptr inbounds nuw i16, ptr %a, i32 %add19
+  %4 = load i16, ptr %arrayidx20, align 2
+  %5 = load i8, ptr %filter, align 1
+  %conv23 = zext i8 %5 to i16
+  %mul24 = mul i16 %4, %conv23
+  %arrayidx28 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 2
+  %6 = load i16, ptr %arrayidx28, align 2
+  %7 = load i8, ptr %arrayidx9, align 1
+  %conv31 = zext i8 %7 to i16
+  %mul32 = mul i16 %6, %conv31
+  %add33 = add i16 %mul24, 64
+  %add34 = add i16 %add33, %mul32
+  %shr35 = lshr i16 %add34, 7
+  %conv36 = trunc i16 %shr35 to i8
+  %arrayidx39 = getelementptr inbounds nuw i8, ptr %b, i32 %add19
+  store i8 %conv36, ptr %arrayidx39, align 1
+  %add41 = or disjoint i32 %mul, 2
+  %arrayidx42 = getelementptr inbounds nuw i16, ptr %a, i32 %add41
+  %8 = load i16, ptr %arrayidx42, align 2
+  %9 = load i8, ptr %filter, align 1
+  %conv45 = zext i8 %9 to i16
+  %mul46 = mul i16 %8, %conv45
+  %arrayidx50 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 4
+  %10 = load i16, ptr %arrayidx50, align 2
+  %11 = load i8, ptr %arrayidx9, align 1
+  %conv53 = zext i8 %11 to i16
+  %mul54 = mul i16 %10, %conv53
+  %add55 = add i16 %mul46, 64
+  %add56 = add i16 %add55, %mul54
+  %shr57 = lshr i16 %add56, 7
+  %conv58 = trunc i16 %shr57 to i8
+  %arrayidx61 = getelementptr inbounds nuw i8, ptr %b, i32 %add41
+  store i8 %conv58, ptr %arrayidx61, align 1
+  %add63 = or disjoint i32 %mul, 3
+  %arrayidx64 = getelementptr inbounds nuw i16, ptr %a, i32 %add63
+  %12 = load i16, ptr %arrayidx64, align 2
+  %13 = load i8, ptr %filter, align 1
+  %conv67 = zext i8 %13 to i16
+  %mul68 = mul i16 %12, %conv67
+  %arrayidx72 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 6
+  %14 = load i16, ptr %arrayidx72, align 2
+  %15 = load i8, ptr %arrayidx9, align 1
+  %conv75 = zext i8 %15 to i16
+  %mul76 = mul i16 %14, %conv75
+  %add77 = add i16 %mul68, 64
+  %add78 = add i16 %add77, %mul76
+  %shr79 = lshr i16 %add78, 7
+  %conv80 = trunc i16 %shr79 to i8
+  %arrayidx83 = getelementptr inbounds nuw i8, ptr %b, i32 %add63
+  store i8 %conv80, ptr %arrayidx83, align 1
+  %add85 = or disjoint i32 %mul, 4
+  %arrayidx86 = getelementptr inbounds nuw i16, ptr %a, i32 %add85
+  %16 = load i16, ptr %arrayidx86, align 2
+  %17 = load i8, ptr %filter, align 1
+  %conv89 = zext i8 %17 to i16
+  %mul90 = mul i16 %16, %conv89
+  %arrayidx94 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 8
+  %18 = load i16, ptr %arrayidx94, align 2
+  %19 = load i8, ptr %arrayidx9, align 1
+  %conv97 = zext i8 %19 to i16
+  %mul98 = mul i16 %18, %conv97
+  %add99 = add i16 %mul90, 64
+  %add100 = add i16 %add99, %mul98
+  %shr101 = lshr i16 %add100, 7
+  %conv102 = trunc i16 %shr101 to i8
+  %arrayidx105 = getelementptr inbounds nuw i8, ptr %b, i32 %add85
+  store i8 %conv102, ptr %arrayidx105, align 1
+  %add107 = or disjoint i32 %mul, 5
+  %arrayidx108 = getelementptr inbounds nuw i16, ptr %a, i32 %add107
+  %20 = load i16, ptr %arrayidx108, align 2
+  %21 = load i8, ptr %filter, align 1
+  %conv111 = zext i8 %21 to i16
+  %mul112 = mul i16 %20, %conv111
+  %arrayidx116 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 10
+  %22 = load i16, ptr %arrayidx116, align 2
+  %23 = load i8, ptr %arrayidx9, align 1
+  %conv119 = zext i8 %23 to i16
+  %mul120 = mul i16 %22, %conv119
+  %add121 = add i16 %mul112, 64
+  %add122 = add i16 %add121, %mul120
+  %shr123 = lshr i16 %add122, 7
+  %conv124 = trunc i16 %shr123 to i8
+  %arrayidx127 = getelementptr inbounds nuw i8, ptr %b, i32 %add107
+  store i8 %conv124, ptr %arrayidx127, align 1
+  %add129 = or disjoint i32 %mul, 6
+  %arrayidx130 = getelementptr inbounds nuw i16, ptr %a, i32 %add129
+  %24 = load i16, ptr %arrayidx130, align 2
+  %25 = load i8, ptr %filter, align 1
+  %conv133 = zext i8 %25 to i16
+  %mul134 = mul i16 %24, %conv133
+  %arrayidx138 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 12
+  %26 = load i16, ptr %arrayidx138, align 2
+  %27 = load i8, ptr %arrayidx9, align 1
+  %conv141 = zext i8 %27 to i16
+  %mul142 = mul i16 %26, %conv141
+  %add143 = add i16 %mul134, 64
+  %add144 = add i16 %add143, %mul142
+  %shr145 = lshr i16 %add144, 7
+  %conv146 = trunc i16 %shr145 to i8
+  %arrayidx149 = getelementptr inbounds nuw i8, ptr %b, i32 %add129
+  store i8 %conv146, ptr %arrayidx149, align 1
+  %add151 = or disjoint i32 %mul, 7
+  %arrayidx152 = getelementptr inbounds nuw i16, ptr %a, i32 %add151
+  %28 = load i16, ptr %arrayidx152, align 2
+  %29 = load i8, ptr %filter, align 1
+  %conv155 = zext i8 %29 to i16
+  %mul156 = mul i16 %28, %conv155
+  %arrayidx160 = getelementptr inbounds nuw i8, ptr %arrayidx7, i32 14
+  %30 = load i16, ptr %arrayidx160, align 2
+  %31 = load i8, ptr %arrayidx9, align 1
+  %conv163 = zext i8 %31 to i16
+  %mul164 = mul i16 %30, %conv163
+  %add165 = add i16 %mul156, 64
+  %add166 = add i16 %add165, %mul164
+  %shr167 = lshr i16 %add166, 7
+  %conv168 = trunc i16 %shr167 to i8
+  %arrayidx171 = getelementptr inbounds nuw i8, ptr %b, i32 %add151
+  store i8 %conv168, ptr %arrayidx171, align 1
+  %exitcond.not = icmp eq i32 %add4, 16
+  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
+}


        


More information about the llvm-branch-commits mailing list