1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define i32 @main(i1 %tobool.not, i32 %0) {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: movl $1, %r8d
11 ; CHECK-NEXT: testb $1, %dil
12 ; CHECK-NEXT: jne .LBB0_8
13 ; CHECK-NEXT: .LBB0_1: # %j.preheader
14 ; CHECK-NEXT: xorl %r9d, %r9d
15 ; CHECK-NEXT: jmp .LBB0_2
16 ; CHECK-NEXT: .p2align 4, 0x90
17 ; CHECK-NEXT: .LBB0_5: # %if.then4
18 ; CHECK-NEXT: # in Loop: Header=BB0_2 Depth=1
19 ; CHECK-NEXT: movl $1, %eax
20 ; CHECK-NEXT: xorl %edx, %edx
21 ; CHECK-NEXT: divl %r8d
22 ; CHECK-NEXT: testb $1, %dil
23 ; CHECK-NEXT: jne .LBB0_6
24 ; CHECK-NEXT: .LBB0_2: # %j
25 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
26 ; CHECK-NEXT: movl $1, %eax
27 ; CHECK-NEXT: xorl %edx, %edx
28 ; CHECK-NEXT: idivl %esi
29 ; CHECK-NEXT: movl %edx, %ecx
30 ; CHECK-NEXT: testb %r9b, %r9b
31 ; CHECK-NEXT: jne .LBB0_5
32 ; CHECK-NEXT: # %bb.3: # %j
33 ; CHECK-NEXT: # in Loop: Header=BB0_2 Depth=1
34 ; CHECK-NEXT: testl %r9d, %r9d
35 ; CHECK-NEXT: js .LBB0_5
36 ; CHECK-NEXT: # %bb.4:
37 ; CHECK-NEXT: movl %r9d, %edx
38 ; CHECK-NEXT: .LBB0_6: # %if.end9
39 ; CHECK-NEXT: testl %edx, %edx
40 ; CHECK-NEXT: jne .LBB0_7
41 ; CHECK-NEXT: .LBB0_8: # %if.end13
42 ; CHECK-NEXT: xorl %r8d, %r8d
43 ; CHECK-NEXT: jmp .LBB0_1
44 ; CHECK-NEXT: .LBB0_7: # %while.body.lr.ph
45 ; CHECK-NEXT: movl %ecx, %eax
48 br i1 %tobool.not, label %if.end13, label %j.preheader
50 j.preheader: ; preds = %if.end13, %entry
51 %h.0.ph = phi i32 [ 1, %entry ], [ 0, %if.end13 ]
54 j: ; preds = %if.then4, %j.preheader
55 %1 = phi i32 [ %div2, %if.then4 ], [ 0, %j.preheader ]
56 %rem1 = srem i32 1, %0
57 %cmp = icmp slt i32 %1, 0
58 %or.cond = select i1 false, i1 true, i1 %cmp
59 br i1 %or.cond, label %if.then4, label %if.end9
61 if.then4: ; preds = %j
63 %rem5 = srem i32 1, %h.0.ph
64 br i1 %tobool.not, label %if.end9, label %j
66 if.end9: ; preds = %if.then4, %j
67 %2 = phi i32 [ 0, %j ], [ %rem5, %if.then4 ]
68 %tobool10.not = icmp eq i32 %2, 0
69 br i1 %tobool10.not, label %if.end13, label %while.body.lr.ph
71 while.body.lr.ph: ; preds = %if.end9
74 if.end13: ; preds = %if.end9, %entry