1 ; RUN: llc -o - -O0 < %s | FileCheck %s 2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 3 target triple = "x86_64-unknown-linux-gnu" 4 5 define void @test1(i32 %x) #0 { 6 ; CHECK-LABEL: test1: 7 ; CHECK: # BB#0: # %entry 8 ; CHECK-NEXT: pushq %rax 9 ; CHECK-NEXT: testl %edi, %edi 10 ; CHECK-NEXT: setne %al 11 ; CHECK-NEXT: movb %al, %cl 12 ; CHECK-NEXT: kmovw %ecx, %k0 13 ; CHECK-NEXT: kmovb %k0, %eax 14 ; CHECK-NEXT: andb $1, %al 15 ; CHECK-NEXT: movzbl %al, %edi 16 ; CHECK-NEXT: callq callee1 17 ; CHECK-NEXT: popq %rax 18 ; CHECK-NEXT: retq 19 entry: 20 %tobool = icmp ne i32 %x, 0 21 call void @callee1(i1 zeroext %tobool) 22 ret void 23 } 24 25 define void @test2(i32 %x) #0 { 26 ; CHECK-LABEL: test2: 27 ; CHECK: # BB#0: # %entry 28 ; CHECK-NEXT: pushq %rax 29 ; CHECK-NEXT: testl %edi, %edi 30 ; CHECK-NEXT: setne %al 31 ; CHECK-NEXT: movb %al, %cl 32 ; CHECK-NEXT: kmovw %ecx, %k0 33 ; CHECK-NEXT: kmovw %k0, %ecx 34 ; CHECK-NEXT: movb %cl, %al 35 ; CHECK-NEXT: xorl %edi, %edi 36 ; CHECK-NEXT: testb %al, %al 37 ; CHECK-NEXT: movl $-1, %edx 38 ; CHECK-NEXT: cmovnel %edx, %edi 39 ; CHECK-NEXT: callq callee2 40 ; CHECK-NEXT: popq %rax 41 ; CHECK-NEXT: retq 42 entry: 43 %tobool = icmp ne i32 %x, 0 44 call void @callee2(i1 signext %tobool) 45 ret void 46 } 47 48 declare void @callee1(i1 zeroext) 49 declare void @callee2(i1 signext) 50 51 attributes #0 = { nounwind "target-cpu"="skylake-avx512" } 52