1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
5 @g_16 = dso_local global i64 -3738643449681751625, align 8
6 @g_38 = dso_local global i32 0, align 4
7 @.str = private constant [4 x i8] c"%d\0A\00"
9 define dso_local i32 @main() nounwind {
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: xorl %eax, %eax
13 ; CHECK-NEXT: cmpq g_16(%rip), %rax
14 ; CHECK-NEXT: sbbl %eax, %eax
15 ; CHECK-NEXT: testb $-106, %al
16 ; CHECK-NEXT: jle .LBB0_1
17 ; CHECK-NEXT: # %bb.2: # %if.then
18 ; CHECK-NEXT: movl $1, g_38(%rip)
19 ; CHECK-NEXT: movl $1, %esi
20 ; CHECK-NEXT: jmp .LBB0_3
21 ; CHECK-NEXT: .LBB0_1: # %entry.if.end_crit_edge
22 ; CHECK-NEXT: movl g_38(%rip), %esi
23 ; CHECK-NEXT: .LBB0_3: # %if.end
24 ; CHECK-NEXT: pushq %rax
25 ; CHECK-NEXT: movl $.L.str, %edi
26 ; CHECK-NEXT: xorl %eax, %eax
27 ; CHECK-NEXT: callq printf@PLT
28 ; CHECK-NEXT: xorl %eax, %eax
29 ; CHECK-NEXT: popq %rcx
32 %tmp = load i64, ptr @g_16
33 %not.lnot = icmp ne i64 %tmp, 0
34 %conv = sext i1 %not.lnot to i64
35 %and = and i64 %conv, 150
36 %conv.i = trunc i64 %and to i8
37 %cmp = icmp sgt i8 %conv.i, 0
38 br i1 %cmp, label %if.then, label %entry.if.end_crit_edge
40 entry.if.end_crit_edge:
41 %tmp4.pre = load i32, ptr @g_38
45 store i32 1, ptr @g_38
49 %tmp4 = phi i32 [ %tmp4.pre, %entry.if.end_crit_edge ], [ 1, %if.then ] ; <i32> [#uses=1]
50 %call5 = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp4) nounwind ; <i32> [#uses=0]
54 declare i32 @printf(ptr nocapture, ...) nounwind