310 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,X863; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,X644 5declare <32 x i16> @llvm.x86.avx512.permvar.hi.512(<32 x i16>, <32 x i16>)6declare <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)7declare <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16>, <16 x i16>, <16 x i16>, i16)8 9define <16 x i16> @combine_vpermt2var_16i16_identity(<16 x i16> %x0, <16 x i16> %x1) {10; CHECK-LABEL: combine_vpermt2var_16i16_identity:11; CHECK: # %bb.0:12; CHECK-NEXT: ret{{[l|q]}}13 %res0 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x0, <16 x i16> %x1, i16 -1)14 %res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 30, i16 13, i16 28, i16 11, i16 26, i16 9, i16 24, i16 7, i16 22, i16 5, i16 20, i16 3, i16 18, i16 1, i16 16>, <16 x i16> %res0, <16 x i16> %res0, i16 -1)15 ret <16 x i16> %res116}17define <16 x i16> @combine_vpermt2var_16i16_identity_mask(<16 x i16> %x0, <16 x i16> %x1, i16 %m) {18; X86-LABEL: combine_vpermt2var_16i16_identity_mask:19; X86: # %bb.0:20; X86-NEXT: vpmovsxbw {{.*#+}} ymm1 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]21; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k122; X86-NEXT: vpermt2w %ymm0, %ymm1, %ymm0 {%k1} {z}23; X86-NEXT: vpermw %ymm0, %ymm1, %ymm0 {%k1} {z}24; X86-NEXT: retl25;26; X64-LABEL: combine_vpermt2var_16i16_identity_mask:27; X64: # %bb.0:28; X64-NEXT: vpmovsxbw {{.*#+}} ymm1 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]29; X64-NEXT: kmovd %edi, %k130; X64-NEXT: vpermt2w %ymm0, %ymm1, %ymm0 {%k1} {z}31; X64-NEXT: vpermw %ymm0, %ymm1, %ymm0 {%k1} {z}32; X64-NEXT: retq33 %res0 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x0, <16 x i16> %x1, i16 %m)34 %res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 15, i16 30, i16 13, i16 28, i16 11, i16 26, i16 9, i16 24, i16 7, i16 22, i16 5, i16 20, i16 3, i16 18, i16 1, i16 16>, <16 x i16> %res0, <16 x i16> %res0, i16 %m)35 ret <16 x i16> %res136}37 38define <16 x i16> @combine_vpermi2var_16i16_as_permw(<16 x i16> %x0, <16 x i16> %x1) {39; CHECK-LABEL: combine_vpermi2var_16i16_as_permw:40; CHECK: # %bb.0:41; CHECK-NEXT: vpmovsxbw {{.*#+}} ymm1 = [15,0,14,1,13,2,12,3,11,4,10,5,9,6,8,7]42; CHECK-NEXT: vpermw %ymm0, %ymm1, %ymm043; CHECK-NEXT: ret{{[l|q]}}44 %res0 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> <i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, <16 x i16> %x1, i16 -1)45 %res1 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %res0, <16 x i16> <i16 0, i16 15, i16 1, i16 14, i16 2, i16 13, i16 3, i16 12, i16 4, i16 11, i16 5, i16 10, i16 6, i16 9, i16 7, i16 8>, <16 x i16> %res0, i16 -1)46 ret <16 x i16> %res147}48 49define <16 x i16> @combine_vpermt2var_vpermi2var_16i16_as_vperm2(<16 x i16> %x0, <16 x i16> %x1) {50; CHECK-LABEL: combine_vpermt2var_vpermi2var_16i16_as_vperm2:51; CHECK: # %bb.0:52; CHECK-NEXT: vpmovsxbw {{.*#+}} ymm2 = [0,31,2,2,4,29,6,27,8,25,10,23,12,21,14,19]53; CHECK-NEXT: vpermt2w %ymm1, %ymm2, %ymm054; CHECK-NEXT: ret{{[l|q]}}55 %res0 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %x0, <16 x i16> <i16 0, i16 31, i16 2, i16 29, i16 4, i16 27, i16 6, i16 25, i16 8, i16 23, i16 10, i16 21, i16 12, i16 19, i16 14, i16 17>, <16 x i16> %x1, i16 -1)56 %res1 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 0, i16 17, i16 2, i16 18, i16 4, i16 19, i16 6, i16 21, i16 8, i16 23, i16 10, i16 25, i16 12, i16 27, i16 14, i16 29>, <16 x i16> %res0, <16 x i16> %res0, i16 -1)57 ret <16 x i16> %res158}59 60define <16 x i16> @combine_vpermt2var_vpermi2var_16i16_as_unpckhwd(<16 x i16> %a0, <16 x i16> %a1) {61; CHECK-LABEL: combine_vpermt2var_vpermi2var_16i16_as_unpckhwd:62; CHECK: # %bb.0:63; CHECK-NEXT: vpunpckhwd {{.*#+}} ymm0 = ymm1[4],ymm0[4],ymm1[5],ymm0[5],ymm1[6],ymm0[6],ymm1[7],ymm0[7],ymm1[12],ymm0[12],ymm1[13],ymm0[13],ymm1[14],ymm0[14],ymm1[15],ymm0[15]64; CHECK-NEXT: ret{{[l|q]}}65 %res0 = call <16 x i16> @llvm.x86.avx512.mask.vpermi2var.hi.256(<16 x i16> %a0, <16 x i16> <i16 20, i16 4, i16 21, i16 5, i16 22, i16 6, i16 23, i16 7, i16 28, i16 12, i16 29, i16 13, i16 30, i16 14, i16 31, i16 15>, <16 x i16> %a1, i16 -1)66 ret <16 x i16> %res067}68 69define <16 x i16> @combine_vpermt2var_vpermi2var_16i16_as_unpcklwd(<16 x i16> %a0, <16 x i16> %a1) {70; CHECK-LABEL: combine_vpermt2var_vpermi2var_16i16_as_unpcklwd:71; CHECK: # %bb.0:72; CHECK-NEXT: vpunpcklwd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[1],ymm1[1],ymm0[2],ymm1[2],ymm0[3],ymm1[3],ymm0[8],ymm1[8],ymm0[9],ymm1[9],ymm0[10],ymm1[10],ymm0[11],ymm1[11]73; CHECK-NEXT: ret{{[l|q]}}74 %res0 = call <16 x i16> @llvm.x86.avx512.maskz.vpermt2var.hi.256(<16 x i16> <i16 0, i16 16, i16 1, i16 17, i16 2, i16 18, i16 3, i16 19, i16 8, i16 24, i16 9, i16 25, i16 10, i16 26, i16 11, i16 27>, <16 x i16> %a0, <16 x i16> %a1, i16 -1)75 ret <16 x i16> %res076}77 78define <16 x i8> @combine_shuffle_vrotri_v2i64(<2 x i64> %a0) {79; CHECK-LABEL: combine_shuffle_vrotri_v2i64:80; CHECK: # %bb.0:81; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[13,12,11,10,9,8,15,14,5,4,3,2,1,0,7,6]82; CHECK-NEXT: ret{{[l|q]}}83 %1 = call <2 x i64> @llvm.fshr.v2i64(<2 x i64> %a0, <2 x i64> %a0, <2 x i64> <i64 48, i64 48>)84 %2 = bitcast <2 x i64> %1 to <16 x i8>85 %3 = shufflevector <16 x i8> %2, <16 x i8> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>86 ret <16 x i8> %387}88declare <2 x i64> @llvm.fshr.v2i64(<2 x i64>, <2 x i64>, <2 x i64>)89 90define <16 x i8> @combine_shuffle_vrotli_v4i32(<4 x i32> %a0) {91; CHECK-LABEL: combine_shuffle_vrotli_v4i32:92; CHECK: # %bb.0:93; CHECK-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[14,13,12,15,10,9,8,11,6,5,4,7,2,1,0,3]94; CHECK-NEXT: ret{{[l|q]}}95 %1 = call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a0, <4 x i32> %a0, <4 x i32> <i32 8, i32 8, i32 8, i32 8>)96 %2 = bitcast <4 x i32> %1 to <16 x i8>97 %3 = shufflevector <16 x i8> %2, <16 x i8> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>98 ret <16 x i8> %399}100declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)101 102define <16 x i16> @concat2_permw_v8i16(<8 x i16> %x, <8 x i16> %y) nounwind {103; CHECK-LABEL: concat2_permw_v8i16:104; CHECK: # %bb.0:105; CHECK-NEXT: # kill: def $xmm1 killed $xmm1 def $ymm1106; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0107; CHECK-NEXT: vpmovsxbw {{.*#+}} ymm2 = [7,0,6,1,5,2,4,3,21,18,20,19,23,16,22,17]108; CHECK-NEXT: vpermt2w %ymm1, %ymm2, %ymm0109; CHECK-NEXT: ret{{[l|q]}}110 %lo = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %x, <8 x i16> <i16 7, i16 0, i16 6, i16 1, i16 5, i16 2, i16 4, i16 3>)111 %hi = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %y, <8 x i16> <i16 5, i16 2, i16 4, i16 3, i16 7, i16 0, i16 6, i16 1>)112 %res = shufflevector <8 x i16> %lo, <8 x i16> %hi, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>113 ret <16 x i16> %res114}115 116define <32 x i16> @concat4_permw_v8i16(<8 x i16> %x, <8 x i16> %y, <8 x i16> %z, <8 x i16> %w) nounwind {117; X86-LABEL: concat4_permw_v8i16:118; X86: # %bb.0:119; X86-NEXT: pushl %ebp120; X86-NEXT: movl %esp, %ebp121; X86-NEXT: andl $-16, %esp122; X86-NEXT: subl $16, %esp123; X86-NEXT: # kill: def $xmm2 killed $xmm2 def $ymm2124; X86-NEXT: # kill: def $xmm1 killed $xmm1 def $ymm1125; X86-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0126; X86-NEXT: vmovdqa 8(%ebp), %xmm3127; X86-NEXT: vpmovsxbw {{.*#+}} ymm4 = [6,1,7,0,4,3,5,2,20,19,21,18,22,17,23,16]128; X86-NEXT: vpermi2w %ymm3, %ymm2, %ymm4129; X86-NEXT: vpmovsxbw {{.*#+}} ymm2 = [7,0,6,1,5,2,4,3,21,18,20,19,23,16,22,17]130; X86-NEXT: vpermi2w %ymm1, %ymm0, %ymm2131; X86-NEXT: vinserti64x4 $1, %ymm4, %zmm2, %zmm0132; X86-NEXT: movl %ebp, %esp133; X86-NEXT: popl %ebp134; X86-NEXT: retl135;136; X64-LABEL: concat4_permw_v8i16:137; X64: # %bb.0:138; X64-NEXT: # kill: def $xmm3 killed $xmm3 def $ymm3139; X64-NEXT: # kill: def $xmm2 killed $xmm2 def $ymm2140; X64-NEXT: # kill: def $xmm1 killed $xmm1 def $ymm1141; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0142; X64-NEXT: vpmovsxbw {{.*#+}} ymm4 = [6,1,7,0,4,3,5,2,20,19,21,18,22,17,23,16]143; X64-NEXT: vpermi2w %ymm3, %ymm2, %ymm4144; X64-NEXT: vpmovsxbw {{.*#+}} ymm2 = [7,0,6,1,5,2,4,3,21,18,20,19,23,16,22,17]145; X64-NEXT: vpermi2w %ymm1, %ymm0, %ymm2146; X64-NEXT: vinserti64x4 $1, %ymm4, %zmm2, %zmm0147; X64-NEXT: retq148 %px = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %x, <8 x i16> <i16 7, i16 0, i16 6, i16 1, i16 5, i16 2, i16 4, i16 3>)149 %py = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %y, <8 x i16> <i16 5, i16 2, i16 4, i16 3, i16 7, i16 0, i16 6, i16 1>)150 %pz = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %z, <8 x i16> <i16 6, i16 1, i16 7, i16 0, i16 4, i16 3, i16 5, i16 2>)151 %pw = tail call <8 x i16> @llvm.x86.avx512.permvar.hi.128(<8 x i16> %w, <8 x i16> <i16 4, i16 3, i16 5, i16 2, i16 6, i16 1, i16 7, i16 0>)152 %lo = shufflevector <8 x i16> %px, <8 x i16> %py, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>153 %hi = shufflevector <8 x i16> %pz, <8 x i16> %pw, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>154 %res = shufflevector <16 x i16> %lo, <16 x i16> %hi, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>155 ret <32 x i16> %res156}157 158define <8 x i32> @concat_vrotli_v4i32(<4 x i32> %a0, <4 x i32> %a1) {159; CHECK-LABEL: concat_vrotli_v4i32:160; CHECK: # %bb.0:161; CHECK-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0162; CHECK-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0163; CHECK-NEXT: vprold $3, %ymm0, %ymm0164; CHECK-NEXT: ret{{[l|q]}}165 %r0 = tail call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a0, <4 x i32> %a0, <4 x i32> splat (i32 3))166 %r1 = tail call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a1, <4 x i32> %a1, <4 x i32> splat (i32 3))167 %shuffle = shufflevector <4 x i32> %r0, <4 x i32> %r1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>168 ret <8 x i32> %shuffle169}170 171define <8 x i32> @concat_vrotlv_v4i32(<4 x i32> %a0, <4 x i32> %a1, <8 x i32> %a2) {172; CHECK-LABEL: concat_vrotlv_v4i32:173; CHECK: # %bb.0:174; CHECK-NEXT: vextracti128 $1, %ymm2, %xmm3175; CHECK-NEXT: vprolvd %xmm2, %xmm0, %xmm0176; CHECK-NEXT: vprolvd %xmm3, %xmm1, %xmm1177; CHECK-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0178; CHECK-NEXT: ret{{[l|q]}}179 %lo = shufflevector <8 x i32> %a2, <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>180 %hi = shufflevector <8 x i32> %a2, <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>181 %r0 = tail call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a0, <4 x i32> %a0, <4 x i32> %lo)182 %r1 = tail call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %a1, <4 x i32> %a1, <4 x i32> %hi)183 %shuffle = shufflevector <4 x i32> %r0, <4 x i32> %r1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>184 ret <8 x i32> %shuffle185}186 187define <8 x i16> @demandedelts_vpermvar_32i16_v8i16(<32 x i16> %x0) {188; CHECK-LABEL: demandedelts_vpermvar_32i16_v8i16:189; CHECK: # %bb.0:190; CHECK-NEXT: vpmovsxbw {{.*#+}} xmm1 = [7,0,6,1,5,2,4,3]191; CHECK-NEXT: vpermw %xmm0, %xmm1, %xmm0192; CHECK-NEXT: vzeroupper193; CHECK-NEXT: ret{{[l|q]}}194 %shuffle = call <32 x i16> @llvm.x86.avx512.permvar.hi.512(<32 x i16> %x0, <32 x i16> <i16 7, i16 0, i16 6, i16 1, i16 5, i16 2, i16 4, i16 3, i16 31, i16 30, i16 29, i16 28, i16 27, i16 26, i16 25, i16 24, i16 23, i16 22, i16 21, i16 20, i16 19, i16 18, i16 17, i16 16, i16 15, i16 14, i16 13, i16 12, i16 11, i16 10, i16 9, i16 8>)195 %res = shufflevector <32 x i16> %shuffle, <32 x i16> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>196 ret <8 x i16> %res197}198 199define void @PR46178(ptr %0) {200; X86-LABEL: PR46178:201; X86: # %bb.0:202; X86-NEXT: movl {{[0-9]+}}(%esp), %eax203; X86-NEXT: vmovdqu 0, %ymm0204; X86-NEXT: vmovdqu (%eax), %ymm1205; X86-NEXT: vpmovqw %ymm0, %xmm0206; X86-NEXT: vpmovqw %ymm1, %xmm1207; X86-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0208; X86-NEXT: vpsllw $8, %ymm0, %ymm0209; X86-NEXT: vpsraw $8, %ymm0, %ymm0210; X86-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,1]211; X86-NEXT: vmovdqu %ymm0, (%eax)212; X86-NEXT: vzeroupper213; X86-NEXT: retl214;215; X64-LABEL: PR46178:216; X64: # %bb.0:217; X64-NEXT: vmovdqu 0, %ymm0218; X64-NEXT: vmovdqu (%rax), %ymm1219; X64-NEXT: vpmovqw %ymm0, %xmm0220; X64-NEXT: vpmovqw %ymm1, %xmm1221; X64-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0222; X64-NEXT: vpsllw $8, %ymm0, %ymm0223; X64-NEXT: vpsraw $8, %ymm0, %ymm0224; X64-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,1]225; X64-NEXT: vmovdqu %ymm0, (%rdi)226; X64-NEXT: vzeroupper227; X64-NEXT: retq228 %2 = load <4 x i64>, ptr null, align 8229 %3 = load <4 x i64>, ptr undef, align 8230 %4 = trunc <4 x i64> %2 to <4 x i16>231 %5 = trunc <4 x i64> %3 to <4 x i16>232 %6 = shl <4 x i16> %4, <i16 8, i16 8, i16 8, i16 8>233 %7 = shl <4 x i16> %5, <i16 8, i16 8, i16 8, i16 8>234 %8 = ashr exact <4 x i16> %6, <i16 8, i16 8, i16 8, i16 8>235 %9 = ashr exact <4 x i16> %7, <i16 8, i16 8, i16 8, i16 8>236 %10 = getelementptr inbounds i16, ptr %0, i64 4237 %11 = getelementptr inbounds i16, ptr %0, i64 8238 %12 = getelementptr inbounds i16, ptr %0, i64 12239 store <4 x i16> %8, ptr %0, align 2240 store <4 x i16> %9, ptr %10, align 2241 store <4 x i16> zeroinitializer, ptr %11, align 2242 store <4 x i16> zeroinitializer, ptr %12, align 2243 ret void244}245 246define <8 x i32> @PR46393(<8 x i16> %a0, i8 %a1) {247; X86-LABEL: PR46393:248; X86: # %bb.0:249; X86-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero250; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax251; X86-NEXT: kmovd %eax, %k1252; X86-NEXT: vpslld $16, %ymm0, %ymm0 {%k1} {z}253; X86-NEXT: retl254;255; X64-LABEL: PR46393:256; X64: # %bb.0:257; X64-NEXT: vpmovzxwd {{.*#+}} ymm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero258; X64-NEXT: kmovd %edi, %k1259; X64-NEXT: vpslld $16, %ymm0, %ymm0 {%k1} {z}260; X64-NEXT: retq261 %zext = sext <8 x i16> %a0 to <8 x i32>262 %mask = bitcast i8 %a1 to <8 x i1>263 %shl = shl nuw <8 x i32> %zext, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>264 %sel = select <8 x i1> %mask, <8 x i32> %shl, <8 x i32> zeroinitializer265 ret <8 x i32> %sel266}267 268define i64 @PR55050() {269; X86-LABEL: PR55050:270; X86: # %bb.0: # %entry271; X86-NEXT: xorl %eax, %eax272; X86-NEXT: testb %al, %al273; X86-NEXT: jne .LBB15_2274; X86-NEXT: # %bb.1: # %if275; X86-NEXT: xorl %eax, %eax276; X86-NEXT: .LBB15_2: # %exit277; X86-NEXT: movl %eax, %edx278; X86-NEXT: retl279;280; X64-LABEL: PR55050:281; X64: # %bb.0: # %entry282; X64-NEXT: testb %al, %al283; X64-NEXT: xorl %eax, %eax284; X64-NEXT: retq285entry:286 %i275 = call <2 x i64> @llvm.x86.sse2.psad.bw(<16 x i8> undef, <16 x i8> zeroinitializer)287 %i277 = call <2 x i64> @llvm.x86.sse2.psad.bw(<16 x i8> undef, <16 x i8> zeroinitializer)288 br i1 poison, label %exit, label %if289 290if:291 %i298 = bitcast <2 x i64> %i275 to <4 x i32>292 %i299 = bitcast <2 x i64> %i277 to <4 x i32>293 %i300 = shufflevector <4 x i32> %i298, <4 x i32> %i299, <4 x i32> <i32 0, i32 2, i32 4, i32 6>294 %i339 = call <8 x i16> @llvm.x86.sse41.packusdw(<4 x i32> %i300, <4 x i32> undef)295 %i354 = shufflevector <8 x i16> %i339, <8 x i16> undef, <8 x i32> <i32 0, i32 undef, i32 2, i32 undef, i32 4, i32 undef, i32 6, i32 undef>296 %i356 = call <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16> %i354, <8 x i16> undef)297 %i357 = shufflevector <16 x i8> %i356, <16 x i8> zeroinitializer, <16 x i32> <i32 6, i32 5, i32 4, i32 16, i32 2, i32 1, i32 0, i32 16, i32 10, i32 9, i32 8, i32 16, i32 16, i32 16, i32 16, i32 16>298 %i361 = extractelement <16 x i8> %i357, i64 8299 %i360 = and i8 %i361, 63300 %i379 = zext i8 %i360 to i64301 br label %exit302 303exit:304 %res = phi i64 [ %i379, %if ], [ 0, %entry ]305 ret i64 %res306}307declare <2 x i64> @llvm.x86.sse2.psad.bw(<16 x i8>, <16 x i8>)308declare <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16>, <8 x i16>)309declare <8 x i16> @llvm.x86.sse41.packusdw(<4 x i32>, <4 x i32>)310