Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 ; RUN: llc < %s -mattr=+avx512f | FileCheck %s  --check-prefix=CHECK --check-prefix=KNL
      3 ; RUN: llc < %s -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq | FileCheck %s  --check-prefix=CHECK --check-prefix=SKX
      4 
      5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
      6 target triple = "x86_64-unknown-linux-gnu"
      7 
      8 define void @func() {
      9 ; CHECK-LABEL: func:
     10 ; CHECK:       # %bb.0: # %bb1
     11 ; CHECK-NEXT:    xorl %eax, %eax
     12 ; CHECK-NEXT:    testb %al, %al
     13 ; CHECK-NEXT:    je .LBB0_1
     14 ; CHECK-NEXT:  # %bb.4: # %L_30
     15 ; CHECK-NEXT:    retq
     16 ; CHECK-NEXT:  .LBB0_1: # %bb56
     17 ; CHECK-NEXT:    xorl %eax, %eax
     18 ; CHECK-NEXT:    jmp .LBB0_2
     19 ; CHECK-NEXT:    .p2align 4, 0x90
     20 ; CHECK-NEXT:  .LBB0_3: # %bb35
     21 ; CHECK-NEXT:    # in Loop: Header=BB0_2 Depth=1
     22 ; CHECK-NEXT:    testb %al, %al
     23 ; CHECK-NEXT:  .LBB0_2: # %bb33
     24 ; CHECK-NEXT:    # =>This Inner Loop Header: Depth=1
     25 ; CHECK-NEXT:    testb %al, %al
     26 ; CHECK-NEXT:    jne .LBB0_2
     27 ; CHECK-NEXT:    jmp .LBB0_3
     28 bb1:
     29   br i1 undef, label %L_10, label %L_10
     30 
     31 L_10:                                             ; preds = %bb1, %bb1
     32   br i1 undef, label %L_30, label %bb56
     33 
     34 bb56:                                             ; preds = %L_10
     35   br label %bb33
     36 
     37 bb33:                                             ; preds = %bb51, %bb56
     38   %r111 = load i64, i64* undef, align 8
     39   br i1 undef, label %bb51, label %bb35
     40 
     41 bb35:                                             ; preds = %bb33
     42   br i1 undef, label %L_19, label %bb37
     43 
     44 bb37:                                             ; preds = %bb35
     45   %r128 = and i64 %r111, 576460752303423488
     46   %phitmp = icmp eq i64 %r128, 0
     47   br label %L_19
     48 
     49 L_19:                                             ; preds = %bb37, %bb35
     50   %"$V_S25.0" = phi i1 [ %phitmp, %bb37 ], [ true, %bb35 ]
     51   br i1 undef, label %bb51, label %bb42
     52 
     53 bb42:                                             ; preds = %L_19
     54   %r136 = select i1 %"$V_S25.0", i32* undef, i32* undef
     55   br label %bb51
     56 
     57 bb51:                                             ; preds = %bb42, %L_19, %bb33
     58   br i1 false, label %L_30, label %bb33
     59 
     60 L_30:                                             ; preds = %bb51, %L_10
     61   ret void
     62 }
     63 
     64 ; The following test generates suboptimal code on AVX-512
     65 ; PR 28175
     66 define i64 @func2(i1 zeroext %i, i32 %j) {
     67 ; CHECK-LABEL: func2:
     68 ; CHECK:       # %bb.0: # %entry
     69 ; CHECK-NEXT:    testl %esi, %esi
     70 ; CHECK-NEXT:    je .LBB1_1
     71 ; CHECK-NEXT:  # %bb.2: # %if.then
     72 ; CHECK-NEXT:    jmp bar # TAILCALL
     73 ; CHECK-NEXT:  .LBB1_1: # %if.end
     74 ; CHECK-NEXT:    movzbl %dil, %eax
     75 ; CHECK-NEXT:    orq $-2, %rax
     76 ; CHECK-NEXT:    retq
     77 entry:
     78   %tobool = icmp eq i32 %j, 0
     79   br i1 %tobool, label %if.end, label %if.then
     80 
     81 if.then:                                          ; preds = %entry
     82   %call = tail call i64 @bar()
     83   br label %return
     84 
     85 if.end:                                           ; preds = %entry
     86   %conv = zext i1 %i to i64
     87   %or = or i64 %conv, -2
     88   br label %return
     89 
     90 return:                                           ; preds = %if.end, %if.then
     91   %or.sink = phi i64 [ %or, %if.end ], [ %call, %if.then ]
     92   ret i64 %or.sink
     93 }
     94 
     95 declare i64 @bar()
     96