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
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64-unknown-linux-gnu"
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
16 ; CHECK-NEXT: .LBB0_1: # %bb56
17 ; CHECK-NEXT: xorl %eax, %eax
18 ; CHECK-NEXT: .p2align 4, 0x90
19 ; CHECK-NEXT: .LBB0_2: # %bb33
20 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
21 ; CHECK-NEXT: testb %al, %al
22 ; CHECK-NEXT: jne .LBB0_2
23 ; CHECK-NEXT: # %bb.3: # %bb35
24 ; CHECK-NEXT: # in Loop: Header=BB0_2 Depth=1
25 ; CHECK-NEXT: testb %al, %al
26 ; CHECK-NEXT: jmp .LBB0_2
28 br i1 undef, label %L_10, label %L_10
30 L_10: ; preds = %bb1, %bb1
31 br i1 undef, label %L_30, label %bb56
36 bb33: ; preds = %bb51, %bb56
37 %r111 = load i64, i64* undef, align 8
38 br i1 undef, label %bb51, label %bb35
41 br i1 undef, label %L_19, label %bb37
44 %r128 = and i64 %r111, 576460752303423488
45 %phitmp = icmp eq i64 %r128, 0
48 L_19: ; preds = %bb37, %bb35
49 %"$V_S25.0" = phi i1 [ %phitmp, %bb37 ], [ true, %bb35 ]
50 br i1 undef, label %bb51, label %bb42
53 %r136 = select i1 %"$V_S25.0", i32* undef, i32* undef
56 bb51: ; preds = %bb42, %L_19, %bb33
57 br i1 false, label %L_30, label %bb33
59 L_30: ; preds = %bb51, %L_10
63 ; The following test generates suboptimal code on AVX-512
65 define i64 @func2(i1 zeroext %i, i32 %j) {
67 ; CHECK: # %bb.0: # %entry
68 ; CHECK-NEXT: testl %esi, %esi
69 ; CHECK-NEXT: je .LBB1_1
70 ; CHECK-NEXT: # %bb.2: # %if.then
71 ; CHECK-NEXT: jmp bar # TAILCALL
72 ; CHECK-NEXT: .LBB1_1: # %if.end
73 ; CHECK-NEXT: movzbl %dil, %eax
74 ; CHECK-NEXT: orq $-2, %rax
77 %tobool = icmp eq i32 %j, 0
78 br i1 %tobool, label %if.end, label %if.then
80 if.then: ; preds = %entry
81 %call = tail call i64 @bar()
84 if.end: ; preds = %entry
85 %conv = zext i1 %i to i64
86 %or = or i64 %conv, -2
89 return: ; preds = %if.end, %if.then
90 %or.sink = phi i64 [ %or, %if.end ], [ %call, %if.then ]