blob: d917ffe56bbcbbcf1b7abe78815737ffa1d0d66e [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s
Evan Chengff5c7c42009-08-15 07:59:10 +00002
3define void @foo(i32 %X, i32 %Y) {
4entry:
5; CHECK: foo:
6; CHECK: it ne
7; CHECK: cmpne
8; CHECK: it hi
9; CHECK: pophi {r7, pc}
10 %tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
11 %tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
12 %tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
13 br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock
14
15cond_true: ; preds = %entry
16 %tmp10 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
17 ret void
18
19UnifiedReturnBlock: ; preds = %entry
20 ret void
21}
22
23declare i32 @bar(...)
24
25; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
26
27 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
28
29define fastcc i32 @CountTree(%struct.quad_struct* %tree) {
30entry:
31; CHECK: CountTree:
32; CHECK: it eq
33; CHECK: cmpeq
Evan Cheng9dcb7602009-09-04 07:47:40 +000034; CHECK: bne
Evan Chengff5c7c42009-08-15 07:59:10 +000035; CHECK: itt eq
36; CHECK: moveq
37; CHECK: popeq
38 br label %tailrecurse
39
40tailrecurse: ; preds = %bb, %entry
41 %tmp6 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
42 %tmp9 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=2]
43 %tmp12 = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
44 %tmp14 = icmp eq %struct.quad_struct* null, null ; <i1> [#uses=1]
45 %tmp17 = icmp eq %struct.quad_struct* %tmp6, null ; <i1> [#uses=1]
46 %tmp23 = icmp eq %struct.quad_struct* %tmp9, null ; <i1> [#uses=1]
47 %tmp29 = icmp eq %struct.quad_struct* %tmp12, null ; <i1> [#uses=1]
48 %bothcond = and i1 %tmp17, %tmp14 ; <i1> [#uses=1]
49 %bothcond1 = and i1 %bothcond, %tmp23 ; <i1> [#uses=1]
50 %bothcond2 = and i1 %bothcond1, %tmp29 ; <i1> [#uses=1]
51 br i1 %bothcond2, label %return, label %bb
52
53bb: ; preds = %tailrecurse
54 %tmp41 = tail call fastcc i32 @CountTree( %struct.quad_struct* %tmp9 ) ; <i32> [#uses=0]
55 br label %tailrecurse
56
57return: ; preds = %tailrecurse
58 ret i32 0
59}
60
61 %struct.SString = type { i8*, i32, i32 }
62
63declare void @abort()
64
65define fastcc void @t1(%struct.SString* %word, i8 signext %c) {
66entry:
67; CHECK: t1:
68; CHECK: it ne
69; CHECK: popne {r7, pc}
70 %tmp1 = icmp eq %struct.SString* %word, null ; <i1> [#uses=1]
71 br i1 %tmp1, label %cond_true, label %cond_false
72
73cond_true: ; preds = %entry
74 tail call void @abort( )
75 unreachable
76
77cond_false: ; preds = %entry
78 ret void
79}
80
81define fastcc void @t2() nounwind {
82entry:
83; CHECK: t2:
84; CHECK: cmp r0, #0
Evan Cheng08ed20d2009-08-31 20:14:07 +000085; CHECK: beq
Evan Chengff5c7c42009-08-15 07:59:10 +000086 br i1 undef, label %bb.i.i3, label %growMapping.exit
87
88bb.i.i3: ; preds = %entry
89 unreachable
90
91growMapping.exit: ; preds = %entry
92 unreachable
93}