Index: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp =================================================================== --- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -3835,7 +3835,7 @@ } LdOps.push_back(L); - + LdOp = L; LdWidth -= NewVTWidth; } Index: test/CodeGen/X86/pr34653-pr34657.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/pr34653-pr34657.ll @@ -0,0 +1,316 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc %s -O0 -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s -check-prefix=CHECKO0 +; RUN: llc %s -O2 -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s -check-prefix=CHECKO2 + +declare fastcc <38 x double> @test() + +define void @pr34653() { +; CHECKO0-LABEL: pr34653: +; CHECKO0: # BB#0: # %entry +; CHECKO0-NEXT: pushq %rbp +; CHECKO0-NEXT: .cfi_def_cfa_offset 16 +; CHECKO0-NEXT: .cfi_offset %rbp, -16 +; CHECKO0-NEXT: movq %rsp, %rbp +; CHECKO0-NEXT: .cfi_def_cfa_register %rbp +; CHECKO0-NEXT: andq $-512, %rsp # imm = 0xFE00 +; CHECKO0-NEXT: subq $2048, %rsp # imm = 0x800 +; CHECKO0-NEXT: leaq {{[0-9]+}}(%rsp), %rdi +; CHECKO0-NEXT: callq test +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, %xmm1 +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %ymm2 +; CHECKO0-NEXT: vextractf128 $1, %ymm2, %xmm3 +; CHECKO0-NEXT: vmovaps %xmm3, %xmm4 +; CHECKO0-NEXT: vmovaps %xmm2, %xmm5 +; CHECKO0-NEXT: vmovaps %xmm5, %xmm6 +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %zmm7 +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %zmm8 +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %zmm9 +; CHECKO0-NEXT: vmovupd {{[0-9]+}}(%rsp), %zmm10 +; CHECKO0-NEXT: vextractf32x4 $3, %zmm10, %xmm11 +; CHECKO0-NEXT: vmovaps %xmm11, %xmm12 +; CHECKO0-NEXT: vextractf32x4 $2, %zmm10, %xmm13 +; CHECKO0-NEXT: vmovaps %xmm13, %xmm14 +; CHECKO0-NEXT: vmovaps %xmm10, %xmm15 +; CHECKO0-NEXT: vmovaps %xmm15, %xmm2 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $3, %zmm9, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $2, %zmm9, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm9, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $3, %zmm8, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $2, %zmm8, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm8, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $3, %zmm7, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vextractf32x4 $2, %zmm7, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm7, %xmm0 +; CHECKO0-NEXT: vmovaps %xmm0, {{[0-9]+}}(%rsp) # 16-byte Spill +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm3 = xmm3[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm5 = xmm5[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm11 = xmm11[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm13 = xmm13[1,0] +; CHECKO0-NEXT: # kill: %YMM10 %YMM10 %ZMM10 +; CHECKO0-NEXT: vextractf128 $1, %ymm10, %xmm10 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm10, %xmm0 +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm15 = xmm15[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: # kill: %YMM9 %YMM9 %ZMM9 +; CHECKO0-NEXT: vextractf128 $1, %ymm9, %xmm9 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm9, %xmm0 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: # kill: %YMM8 %YMM8 %ZMM8 +; CHECKO0-NEXT: vextractf128 $1, %ymm8, %xmm8 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm8, %xmm0 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: # kill: %YMM7 %YMM7 %ZMM7 +; CHECKO0-NEXT: vextractf128 $1, %ymm7, %xmm7 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps %xmm7, %xmm0 +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovaps {{[0-9]+}}(%rsp), %xmm0 # 16-byte Reload +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm10 = xmm10[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm9 = xmm9[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm8 = xmm8[1,0] +; CHECKO0-NEXT: vpermilpd {{.*#+}} xmm7 = xmm7[1,0] +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd {{[0-9]+}}(%rsp), %xmm0 # 8-byte Reload +; CHECKO0-NEXT: # xmm0 = mem[0],zero +; CHECKO0-NEXT: vmovsd %xmm8, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm13, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm1, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm14, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm2, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm4, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm9, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm10, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm15, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm11, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm3, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm6, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm5, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm12, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm0, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: vmovsd %xmm7, {{[0-9]+}}(%rsp) # 8-byte Spill +; CHECKO0-NEXT: movq %rbp, %rsp +; CHECKO0-NEXT: popq %rbp +; CHECKO0-NEXT: vzeroupper +; CHECKO0-NEXT: ret{{[l|q]}} +; +; CHECKO2-LABEL: pr34653: +; CHECKO2: # BB#0: # %entry +; CHECKO2-NEXT: pushq %rbp +; CHECKO2-NEXT: .cfi_def_cfa_offset 16 +; CHECKO2-NEXT: .cfi_offset %rbp, -16 +; CHECKO2-NEXT: movq %rsp, %rbp +; CHECKO2-NEXT: .cfi_def_cfa_register %rbp +; CHECKO2-NEXT: andq $-512, %rsp # imm = 0xFE00 +; CHECKO2-NEXT: subq $1024, %rsp # imm = 0x400 +; CHECKO2-NEXT: movq %rsp, %rdi +; CHECKO2-NEXT: callq test +; CHECKO2-NEXT: movq %rbp, %rsp +; CHECKO2-NEXT: popq %rbp +; CHECKO2-NEXT: ret{{[l|q]}} +entry: + %v = call fastcc <38 x double> @test() + %v.0 = extractelement <38 x double> %v, i32 0 + ret void +} + + +@u = external local_unnamed_addr global [20 x i32], align 16 + +define void @pr34657() local_unnamed_addr { +; CHECKO0-LABEL: pr34657: +; CHECKO0: # BB#0: # %entry +; CHECKO0-NEXT: # implicit-def: %RAX +; CHECKO0-NEXT: vmovups (%rax), %ymm0 +; CHECKO0-NEXT: # implicit-def: %RAX +; CHECKO0-NEXT: vmovdqu (%rax), %xmm1 +; CHECKO0-NEXT: # implicit-def: %YMM2 +; CHECKO0-NEXT: vmovaps %xmm1, %xmm2 +; CHECKO0-NEXT: vmovaps {{.*#+}} ymm3 = <255,u,0,255,u,u,255,255,u,0,255,u,u,255,255,u,u,255,u,u,255,255,u,u,255,u,u,255,255,u,u,255> +; CHECKO0-NEXT: vpblendvb %ymm3, %ymm0, %ymm2, %ymm0 +; CHECKO0-NEXT: vextracti128 $1, %ymm0, %xmm1 +; CHECKO0-NEXT: vmovdqa {{.*#+}} xmm4 = [128,128,128,5,12,128,128,1,8,15,128,128,4,11,128,128] +; CHECKO0-NEXT: vpshufb %xmm4, %xmm1, %xmm1 +; CHECKO0-NEXT: vmovaps %xmm0, %xmm4 +; CHECKO0-NEXT: vmovdqa {{.*#+}} xmm5 = [0,7,14,128,128,3,10,128,128,128,6,13,128,128,2,9] +; CHECKO0-NEXT: vpshufb %xmm5, %xmm4, %xmm4 +; CHECKO0-NEXT: vpor %xmm1, %xmm4, %xmm1 +; CHECKO0-NEXT: vpmovzxbd {{.*#+}} zmm6 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero,xmm1[8],zero,zero,zero,xmm1[9],zero,zero,zero,xmm1[10],zero,zero,zero,xmm1[11],zero,zero,zero,xmm1[12],zero,zero,zero,xmm1[13],zero,zero,zero,xmm1[14],zero,zero,zero,xmm1[15],zero,zero,zero +; CHECKO0-NEXT: vmovaps %xmm6, %xmm1 +; CHECKO0-NEXT: vmovd %xmm1, %ecx +; CHECKO0-NEXT: addl $0, %ecx +; CHECKO0-NEXT: movl %ecx, u +; CHECKO0-NEXT: vzeroupper +; CHECKO0-NEXT: ret{{[l|q]}} +; +; CHECKO2-LABEL: pr34657: +; CHECKO2: # BB#0: # %entry +; CHECKO2-NEXT: vmovdqu (%rax), %xmm0 +; CHECKO2-NEXT: vmovdqu (%rax), %ymm1 +; CHECKO2-NEXT: vmovdqu64 (%rax), %zmm2 +; CHECKO2-NEXT: vpextrb $7, %xmm2, %eax +; CHECKO2-NEXT: vpextrb $0, %xmm2, %ecx +; CHECKO2-NEXT: vmovd %ecx, %xmm3 +; CHECKO2-NEXT: vpinsrb $1, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vpextrb $14, %xmm2, %eax +; CHECKO2-NEXT: vpinsrb $2, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vextracti128 $1, %ymm2, %xmm4 +; CHECKO2-NEXT: vpextrb $5, %xmm4, %eax +; CHECKO2-NEXT: vpinsrb $3, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vpextrb $12, %xmm4, %eax +; CHECKO2-NEXT: vpinsrb $4, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vextracti32x4 $2, %zmm2, %xmm4 +; CHECKO2-NEXT: vpextrb $3, %xmm4, %eax +; CHECKO2-NEXT: vpinsrb $5, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vpextrb $10, %xmm4, %eax +; CHECKO2-NEXT: vpinsrb $6, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vextracti32x4 $3, %zmm2, %xmm2 +; CHECKO2-NEXT: vpextrb $1, %xmm2, %eax +; CHECKO2-NEXT: vpinsrb $7, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vpextrb $8, %xmm2, %eax +; CHECKO2-NEXT: vpinsrb $8, %eax, %xmm3, %xmm3 +; CHECKO2-NEXT: vpextrb $15, %xmm2, %eax +; CHECKO2-NEXT: vpinsrb $9, %eax, %xmm3, %xmm2 +; CHECKO2-NEXT: vpextrb $6, %xmm1, %eax +; CHECKO2-NEXT: vpinsrb $10, %eax, %xmm2, %xmm2 +; CHECKO2-NEXT: vpextrb $13, %xmm1, %eax +; CHECKO2-NEXT: vpinsrb $11, %eax, %xmm2, %xmm2 +; CHECKO2-NEXT: vextracti128 $1, %ymm1, %xmm1 +; CHECKO2-NEXT: vpextrb $4, %xmm1, %eax +; CHECKO2-NEXT: vpinsrb $12, %eax, %xmm2, %xmm2 +; CHECKO2-NEXT: vpextrb $11, %xmm1, %eax +; CHECKO2-NEXT: vpinsrb $13, %eax, %xmm2, %xmm1 +; CHECKO2-NEXT: vpextrb $2, %xmm0, %eax +; CHECKO2-NEXT: vpinsrb $14, %eax, %xmm1, %xmm1 +; CHECKO2-NEXT: vpextrb $9, %xmm0, %eax +; CHECKO2-NEXT: vpinsrb $15, %eax, %xmm1, %xmm0 +; CHECKO2-NEXT: vpmovzxbd {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero,xmm0[8],zero,zero,zero,xmm0[9],zero,zero,zero,xmm0[10],zero,zero,zero,xmm0[11],zero,zero,zero,xmm0[12],zero,zero,zero,xmm0[13],zero,zero,zero,xmm0[14],zero,zero,zero,xmm0[15],zero,zero,zero +; CHECKO2-NEXT: vmovd %xmm0, {{.*}}(%rip) +; CHECKO2-NEXT: vzeroupper +; CHECKO2-NEXT: ret{{[l|q]}} +entry: + %wide.vec51 = load <112 x i8>, <112 x i8>* undef, align 2 + %strided.vec54 = shufflevector <112 x i8> %wide.vec51, <112 x i8> undef, <16 x i32> + %0 = zext <16 x i8> %strided.vec54 to <16 x i32> + %1 = add <16 x i32> zeroinitializer, %0 + %bin.rdx56 = add <16 x i32> %1, zeroinitializer + %bin.rdx57 = add <16 x i32> zeroinitializer, %bin.rdx56 + %bin.rdx58 = add <16 x i32> %bin.rdx57, zeroinitializer + %bin.rdx60 = add <16 x i32> %bin.rdx58, zeroinitializer + %bin.rdx62 = add <16 x i32> %bin.rdx60, zeroinitializer + %bin.rdx64 = add <16 x i32> %bin.rdx62, zeroinitializer + %2 = extractelement <16 x i32> %bin.rdx64, i32 0 + %add18 = add i32 %2, 0 + store i32 %add18, i32* getelementptr inbounds ([20 x i32], [20 x i32]* @u, i64 0, i64 0), align 16 + ret void +} +