• 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:    vmovdqa {{.*#+}} xmm3 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
17; AVX-NEXT:    vpshufb %xmm3, %xmm1, %xmm1
18; AVX-NEXT:    vpcmpeqd %xmm2, %xmm0, %xmm0
19; AVX-NEXT:    vpshufb %xmm3, %xmm0, %xmm0
20; AVX-NEXT:    vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
21; AVX-NEXT:    vpor {{.*}}(%rip), %xmm0, %xmm0
22; AVX-NEXT:    vpsllw $15, %xmm0, %xmm0
23; AVX-NEXT:    vpsraw $15, %xmm0, %xmm0
24; AVX-NEXT:    vzeroupper
25; AVX-NEXT:    retq
26entry:
27  %0 = trunc <8 x i32> %a to <8 x i23>
28  %1 = icmp eq <8 x i23> %0, zeroinitializer
29  %2 = or <8 x i1> %1, <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>
30  %3 = sext <8 x i1> %2 to <8 x i16>
31  ret <8 x i16> %3
32}
33
34define void @pr26232(i64 %a) {
35; KNL-32-LABEL: pr26232:
36; KNL-32:       # BB#0: # %for_loop599.preheader
37; KNL-32-NEXT:    pushl %esi
38; KNL-32-NEXT:  .Ltmp0:
39; KNL-32-NEXT:    .cfi_def_cfa_offset 8
40; KNL-32-NEXT:  .Ltmp1:
41; KNL-32-NEXT:    .cfi_offset %esi, -8
42; KNL-32-NEXT:    movl {{[0-9]+}}(%esp), %eax
43; KNL-32-NEXT:    movl {{[0-9]+}}(%esp), %ecx
44; KNL-32-NEXT:    movw $-1, %dx
45; KNL-32-NEXT:    .p2align 4, 0x90
46; KNL-32-NEXT:  .LBB1_1: # %for_loop599
47; KNL-32-NEXT:    # =>This Inner Loop Header: Depth=1
48; KNL-32-NEXT:    cmpl $65536, %ecx # imm = 0x10000
49; KNL-32-NEXT:    movl %eax, %esi
50; KNL-32-NEXT:    sbbl $0, %esi
51; KNL-32-NEXT:    movl $0, %esi
52; KNL-32-NEXT:    cmovlw %dx, %si
53; KNL-32-NEXT:    testw %si, %si
54; KNL-32-NEXT:    jne .LBB1_1
55; KNL-32-NEXT:  # BB#2: # %for_exit600
56; KNL-32-NEXT:    popl %esi
57; KNL-32-NEXT:    retl
58allocas:
59  br label %for_test11.preheader
60
61for_test11.preheader:                             ; preds = %for_test11.preheader, %allocas
62  br i1 undef, label %for_loop599, label %for_test11.preheader
63
64for_loop599:                                      ; preds = %for_loop599, %for_test11.preheader
65  %less_i_load605_ = icmp slt i64 %a, 65536
66  %less_i_load605__broadcast_init = insertelement <16 x i1> undef, i1 %less_i_load605_, i32 0
67  %less_i_load605__broadcast = shufflevector <16 x i1> %less_i_load605__broadcast_init, <16 x i1> undef, <16 x i32> zeroinitializer
68  %"oldMask&test607" = and <16 x i1> %less_i_load605__broadcast, undef
69  %intmask.i894 = bitcast <16 x i1> %"oldMask&test607" to i16
70  %res.i895 = icmp eq i16 %intmask.i894, 0
71  br i1 %res.i895, label %for_exit600, label %for_loop599
72
73for_exit600:                                      ; preds = %for_loop599
74  ret void
75}
76