blob: 1e068f9194894dd5c1c58496597ae2c709475ebb [file]
; 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
}