1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc < %s -mtriple=aarch64 -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define i1 @load_bv_v4i8(i1 zeroext %a) {
6 ; CHECK-LABEL: load_bv_v4i8:
10 %c = icmp eq i32 %b, 1
14 define noundef i1 @logger(i32 noundef %logLevel, ptr %ea, ptr %pll) {
15 ; CHECK-SD-LABEL: logger:
16 ; CHECK-SD: // %bb.0: // %entry
17 ; CHECK-SD-NEXT: ldr w8, [x2]
18 ; CHECK-SD-NEXT: cmp w8, w0
19 ; CHECK-SD-NEXT: b.ls .LBB1_2
20 ; CHECK-SD-NEXT: // %bb.1:
21 ; CHECK-SD-NEXT: mov w0, wzr
23 ; CHECK-SD-NEXT: .LBB1_2: // %land.rhs
24 ; CHECK-SD-NEXT: ldr x8, [x1]
25 ; CHECK-SD-NEXT: ldrb w0, [x8]
28 ; CHECK-GI-LABEL: logger:
29 ; CHECK-GI: // %bb.0: // %entry
30 ; CHECK-GI-NEXT: ldr w8, [x2]
31 ; CHECK-GI-NEXT: cmp w8, w0
32 ; CHECK-GI-NEXT: mov w0, wzr
33 ; CHECK-GI-NEXT: b.hi .LBB1_2
34 ; CHECK-GI-NEXT: // %bb.1: // %land.rhs
35 ; CHECK-GI-NEXT: ldr x8, [x1]
36 ; CHECK-GI-NEXT: ldrb w8, [x8]
37 ; CHECK-GI-NEXT: and w0, w8, #0x1
38 ; CHECK-GI-NEXT: .LBB1_2: // %land.end
41 %0 = load i32, ptr %pll, align 4
42 %cmp.not = icmp ugt i32 %0, %logLevel
43 br i1 %cmp.not, label %land.end, label %land.rhs
45 land.rhs: ; preds = %entry
46 %1 = load ptr, ptr %ea, align 8
47 %2 = load i8, ptr %1, align 1, !range !14, !noundef !15
48 %tobool.i = icmp ne i8 %2, 0
51 land.end: ; preds = %land.rhs, %entry
52 %3 = phi i1 [ false, %entry ], [ %tobool.i, %land.rhs ]
59 declare i64 @llvm.ctlz.i64(i64 %in, i1)
60 define i1 @lshr_ctlz_undef_cmpeq_one_i64(i64 %in) {
61 ; CHECK-SD-LABEL: lshr_ctlz_undef_cmpeq_one_i64:
63 ; CHECK-SD-NEXT: clz x8, x0
64 ; CHECK-SD-NEXT: lsr x0, x8, #6
65 ; CHECK-SD-NEXT: // kill: def $w0 killed $w0 killed $x0
68 ; CHECK-GI-LABEL: lshr_ctlz_undef_cmpeq_one_i64:
70 ; CHECK-GI-NEXT: clz x8, x0
71 ; CHECK-GI-NEXT: lsr w0, w8, #6
73 %ctlz = call i64 @llvm.ctlz.i64(i64 %in, i1 -1)
74 %lshr = lshr i64 %ctlz, 6
75 %icmp = icmp eq i64 %lshr, 1
79 define i32 @PR17487(i1 %tobool) {
80 ; CHECK-SD-LABEL: PR17487:
82 ; CHECK-SD-NEXT: dup v0.2s, w0
83 ; CHECK-SD-NEXT: mov w8, #1 // =0x1
84 ; CHECK-SD-NEXT: dup v1.2d, x8
85 ; CHECK-SD-NEXT: ushll v0.2d, v0.2s, #0
86 ; CHECK-SD-NEXT: bic v0.16b, v1.16b, v0.16b
87 ; CHECK-SD-NEXT: mov x8, v0.d[1]
88 ; CHECK-SD-NEXT: cmp x8, #1
89 ; CHECK-SD-NEXT: cset w0, ne
92 ; CHECK-GI-LABEL: PR17487:
94 ; CHECK-GI-NEXT: // kill: def $w0 killed $w0 def $x0
95 ; CHECK-GI-NEXT: mov v0.d[1], x0
96 ; CHECK-GI-NEXT: adrp x8, .LCPI3_0
97 ; CHECK-GI-NEXT: ldr q1, [x8, :lo12:.LCPI3_0]
98 ; CHECK-GI-NEXT: bic v0.16b, v1.16b, v0.16b
99 ; CHECK-GI-NEXT: mov d0, v0.d[1]
100 ; CHECK-GI-NEXT: fmov x8, d0
101 ; CHECK-GI-NEXT: cmp x8, #1
102 ; CHECK-GI-NEXT: cset w0, ne
104 %tmp = insertelement <2 x i1> undef, i1 %tobool, i32 1
105 %tmp1 = zext <2 x i1> %tmp to <2 x i64>
106 %tmp2 = xor <2 x i64> %tmp1, <i64 1, i64 1>
107 %tmp3 = extractelement <2 x i64> %tmp2, i32 1
108 %add = add nsw i64 0, %tmp3
109 %cmp6 = icmp ne i64 %add, 1
110 %conv7 = zext i1 %cmp6 to i32