1 ; RUN: llc -fast-isel -fast-isel-abort=1 -aarch64-atomic-cfg-tidy=0 -verify-machineinstrs -mtriple=aarch64-apple-darwin < %s | FileCheck %s 2 3 define i32 @icmp_eq_i1(i1 %a) { 4 ; CHECK-LABEL: icmp_eq_i1 5 ; CHECK: tbz w0, #0, {{LBB.+_2}} 6 %1 = icmp eq i1 %a, 0 7 br i1 %1, label %bb1, label %bb2 8 bb2: 9 ret i32 1 10 bb1: 11 ret i32 0 12 } 13 14 define i32 @icmp_eq_i8(i8 %a) { 15 ; CHECK-LABEL: icmp_eq_i8 16 ; CHECK: uxtb [[REG:w[0-9]+]], w0 17 ; CHECK: cbz [[REG]], {{LBB.+_2}} 18 %1 = icmp eq i8 %a, 0 19 br i1 %1, label %bb1, label %bb2 20 bb2: 21 ret i32 1 22 bb1: 23 ret i32 0 24 } 25 26 define i32 @icmp_eq_i16(i16 %a) { 27 ; CHECK-LABEL: icmp_eq_i16 28 ; CHECK: uxth [[REG:w[0-9]+]], w0 29 ; CHECK: cbz [[REG]], {{LBB.+_2}} 30 %1 = icmp eq i16 %a, 0 31 br i1 %1, label %bb1, label %bb2 32 bb2: 33 ret i32 1 34 bb1: 35 ret i32 0 36 } 37 38 define i32 @icmp_eq_i32(i32 %a) { 39 ; CHECK-LABEL: icmp_eq_i32 40 ; CHECK: cbz w0, {{LBB.+_2}} 41 %1 = icmp eq i32 %a, 0 42 br i1 %1, label %bb1, label %bb2 43 bb2: 44 ret i32 1 45 bb1: 46 ret i32 0 47 } 48 49 define i32 @icmp_eq_i64(i64 %a) { 50 ; CHECK-LABEL: icmp_eq_i64 51 ; CHECK: cbz x0, {{LBB.+_2}} 52 %1 = icmp eq i64 %a, 0 53 br i1 %1, label %bb1, label %bb2 54 bb2: 55 ret i32 1 56 bb1: 57 ret i32 0 58 } 59 60 define i32 @icmp_eq_ptr(i8* %a) { 61 ; CHECK-LABEL: icmp_eq_ptr 62 ; CHECK: cbz x0, {{LBB.+_2}} 63 %1 = icmp eq i8* %a, null 64 br i1 %1, label %bb1, label %bb2 65 bb2: 66 ret i32 1 67 bb1: 68 ret i32 0 69 } 70 71