1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=ivybridge -mattr=+avx2 | FileCheck %s
3 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=haswell | FileCheck %s
5 define <2 x i64> @PR55158(ptr %0) {
6 ; CHECK-LABEL: PR55158:
8 ; CHECK-NEXT: vpxor %xmm0, %xmm0, %xmm0
9 ; CHECK-NEXT: vphsubw 64(%rdi), %xmm0, %xmm0
11 %2 = load <16 x i8>, ptr %0, align 16
12 %3 = getelementptr inbounds i32, ptr %0, i64 16
13 %4 = load <8 x i16>, ptr %3, align 16
14 %5 = getelementptr inbounds i32, ptr %0, i64 32
15 %6 = load <4 x i32>, ptr %5, align 16
16 %7 = shufflevector <16 x i8> %2, <16 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
17 %8 = sext <4 x i8> %7 to <4 x i32>
18 %9 = icmp sgt <4 x i32> %6, %8
19 %10 = sext <4 x i1> %9 to <4 x i32>
20 %11 = tail call <8 x i16> @llvm.x86.ssse3.phsub.w.128(<8 x i16> %4, <8 x i16> %4)
21 %12 = bitcast <8 x i16> %11 to <2 x i64>
22 %13 = shufflevector <4 x i32> %10, <4 x i32> poison, <2 x i32> <i32 0, i32 1>
23 %14 = zext <2 x i32> %13 to <2 x i64>
24 %15 = bitcast <8 x i16> %11 to <16 x i8>
25 %16 = icmp ne <16 x i8> %15, zeroinitializer
26 %17 = sext <16 x i1> %16 to <16 x i8>
27 %18 = shufflevector <16 x i8> %17, <16 x i8> poison, <2 x i32> <i32 0, i32 1>
28 %19 = zext <2 x i8> %18 to <2 x i64>
29 %20 = insertelement <2 x i64> %19, i64 0, i64 1
30 %21 = tail call <2 x i64> @llvm.x86.avx2.psrlv.q(<2 x i64> %20, <2 x i64> %14)
31 %22 = shufflevector <2 x i64> %21, <2 x i64> %12, <2 x i32> <i32 1, i32 3>
34 declare <8 x i16> @llvm.x86.ssse3.phsub.w.128(<8 x i16>, <8 x i16>)
35 declare <2 x i64> @llvm.x86.avx2.psrlv.q(<2 x i64>, <2 x i64>)