1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -o - -O0 < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 define void @test1(i32 %x) #0 {
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: pushq %rax
10 ; CHECK-NEXT: cmpl $0, %edi
11 ; CHECK-NEXT: setne %al
12 ; CHECK-NEXT: movzbl %al, %ecx
13 ; CHECK-NEXT: andl $1, %ecx
14 ; CHECK-NEXT: movl %ecx, %edi
15 ; CHECK-NEXT: callq callee1
16 ; CHECK-NEXT: popq %rax
19 %tobool = icmp ne i32 %x, 0
20 call void @callee1(i1 zeroext %tobool)
24 define void @test2(i32 %x) #0 {
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: pushq %rax
28 ; CHECK-NEXT: cmpl $0, %edi
29 ; CHECK-NEXT: setne %al
30 ; CHECK-NEXT: movzbl %al, %ecx
31 ; CHECK-NEXT: andl $1, %ecx
32 ; CHECK-NEXT: negl %ecx
33 ; CHECK-NEXT: movl %ecx, %edi
34 ; CHECK-NEXT: callq callee2
35 ; CHECK-NEXT: popq %rax
38 %tobool = icmp ne i32 %x, 0
39 call void @callee2(i1 signext %tobool)
43 declare void @callee1(i1 zeroext)
44 declare void @callee2(i1 signext)
46 attributes #0 = { nounwind "target-cpu"="skylake-avx512" }