• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=+avx < %s | FileCheck %s --check-prefix=AVX
3; RUN: llc -mtriple=i386-unknown-linux-gnu -mcpu=knl < %s   | FileCheck %s --check-prefix=KNL-32
4
5
6; Verify that we don't crash during codegen due to a wrong lowering
7; of a setcc node with illegal operand types and return type.
8
9define <8 x i16> @pr25080(<8 x i32> %a) {
10; AVX-LABEL: pr25080:
11; AVX:       # %bb.0: # %entry
12; AVX-NEXT:    vandps {{.*}}(%rip), %ymm0, %ymm0
13; AVX-NEXT:    vextractf128 $1, %ymm0, %xmm1
14; AVX-NEXT:    vpxor %xmm2, %xmm2, %xmm2
15; AVX-NEXT:    vpcmpeqd %xmm2, %xmm1, %xmm1
16; AVX-NEXT:    vpcmpeqd %xmm2, %xmm0, %xmm0
17; AVX-NEXT:    vpackssdw %xmm1, %xmm0, %xmm0
18; AVX-NEXT:    vpor {{.*}}(%rip), %xmm0, %xmm0
19; AVX-NEXT:    vpsllw $15, %xmm0, %xmm0
20; AVX-NEXT:    vpsraw $15, %xmm0, %xmm0
21; AVX-NEXT:    vzeroupper
22; AVX-NEXT:    retq
23;
24; KNL-32-LABEL: pr25080:
25; KNL-32:       # %bb.0: # %entry
26; KNL-32-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
27; KNL-32-NEXT:    vpbroadcastd {{.*#+}} ymm1 = [8388607,8388607,8388607,8388607,8388607,8388607,8388607,8388607]
28; KNL-32-NEXT:    vptestnmd %zmm1, %zmm0, %k0
29; KNL-32-NEXT:    movb $15, %al
30; KNL-32-NEXT:    kmovw %eax, %k1
31; KNL-32-NEXT:    korw %k1, %k0, %k1
32; KNL-32-NEXT:    vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
33; KNL-32-NEXT:    vpmovdw %zmm0, %ymm0
34; KNL-32-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
35; KNL-32-NEXT:    retl
36entry:
37  %0 = trunc <8 x i32> %a to <8 x i23>
38  %1 = icmp eq <8 x i23> %0, zeroinitializer
39  %2 = or <8 x i1> %1, <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>
40  %3 = sext <8 x i1> %2 to <8 x i16>
41  ret <8 x i16> %3
42}
43
44define void @pr26232(i64 %a, <16 x i1> %b) {
45; AVX-LABEL: pr26232:
46; AVX:       # %bb.0: # %allocas
47; AVX-NEXT:    vpxor %xmm1, %xmm1, %xmm1
48; AVX-NEXT:    vmovdqa {{.*#+}} xmm2 = [128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128]
49; AVX-NEXT:    .p2align 4, 0x90
50; AVX-NEXT:  .LBB1_1: # %for_loop599
51; AVX-NEXT:    # =>This Inner Loop Header: Depth=1
52; AVX-NEXT:    xorl %eax, %eax
53; AVX-NEXT:    cmpq $65536, %rdi # imm = 0x10000
54; AVX-NEXT:    setl %al
55; AVX-NEXT:    vmovd %eax, %xmm3
56; AVX-NEXT:    vpshufb %xmm1, %xmm3, %xmm3
57; AVX-NEXT:    vpand %xmm0, %xmm3, %xmm3
58; AVX-NEXT:    vpsllw $7, %xmm3, %xmm3
59; AVX-NEXT:    vpand %xmm2, %xmm3, %xmm3
60; AVX-NEXT:    vpmovmskb %xmm3, %eax
61; AVX-NEXT:    testw %ax, %ax
62; AVX-NEXT:    jne .LBB1_1
63; AVX-NEXT:  # %bb.2: # %for_exit600
64; AVX-NEXT:    retq
65;
66; KNL-32-LABEL: pr26232:
67; KNL-32:       # %bb.0: # %allocas
68; KNL-32-NEXT:    pushl %esi
69; KNL-32-NEXT:    .cfi_def_cfa_offset 8
70; KNL-32-NEXT:    .cfi_offset %esi, -8
71; KNL-32-NEXT:    vpmovsxbd %xmm0, %zmm0
72; KNL-32-NEXT:    vpslld $31, %zmm0, %zmm0
73; KNL-32-NEXT:    vptestmd %zmm0, %zmm0, %k0
74; KNL-32-NEXT:    movl {{[0-9]+}}(%esp), %eax
75; KNL-32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
76; KNL-32-NEXT:    movl $65535, %edx # imm = 0xFFFF
77; KNL-32-NEXT:    .p2align 4, 0x90
78; KNL-32-NEXT:  .LBB1_1: # %for_loop599
79; KNL-32-NEXT:    # =>This Inner Loop Header: Depth=1
80; KNL-32-NEXT:    cmpl $65536, %ecx # imm = 0x10000
81; KNL-32-NEXT:    movl %eax, %esi
82; KNL-32-NEXT:    sbbl $0, %esi
83; KNL-32-NEXT:    movl $0, %esi
84; KNL-32-NEXT:    cmovll %edx, %esi
85; KNL-32-NEXT:    kmovw %esi, %k1
86; KNL-32-NEXT:    kandw %k0, %k1, %k1
87; KNL-32-NEXT:    kortestw %k1, %k1
88; KNL-32-NEXT:    jne .LBB1_1
89; KNL-32-NEXT:  # %bb.2: # %for_exit600
90; KNL-32-NEXT:    popl %esi
91; KNL-32-NEXT:    .cfi_def_cfa_offset 4
92; KNL-32-NEXT:    retl
93allocas:
94  br label %for_test11.preheader
95
96for_test11.preheader:                             ; preds = %for_test11.preheader, %allocas
97  br i1 undef, label %for_loop599, label %for_test11.preheader
98
99for_loop599:                                      ; preds = %for_loop599, %for_test11.preheader
100  %less_i_load605_ = icmp slt i64 %a, 65536
101  %less_i_load605__broadcast_init = insertelement <16 x i1> undef, i1 %less_i_load605_, i32 0
102  %less_i_load605__broadcast = shufflevector <16 x i1> %less_i_load605__broadcast_init, <16 x i1> undef, <16 x i32> zeroinitializer
103  %"oldMask&test607" = and <16 x i1> %less_i_load605__broadcast, %b
104  %intmask.i894 = bitcast <16 x i1> %"oldMask&test607" to i16
105  %res.i895 = icmp eq i16 %intmask.i894, 0
106  br i1 %res.i895, label %for_exit600, label %for_loop599
107
108for_exit600:                                      ; preds = %for_loop599
109  ret void
110}
111