blob: 7b9d0cf32cff07f1fd18378f7bff4e23630bf916 [file] [log] [blame]
Evan Cheng86050dc2010-06-18 23:09:54 +00001; RUN: llc < %s -march=arm | FileCheck %s
Evan Cheng60c916b2007-06-20 18:26:15 +00002
3define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) {
Evan Cheng86050dc2010-06-18 23:09:54 +00004; CHECK: t1:
5; CHECK: bxlt lr
Evan Cheng60c916b2007-06-20 18:26:15 +00006 %tmp2 = icmp sgt i32 %c, 10
7 %tmp5 = icmp slt i32 %d, 4
8 %tmp8 = or i1 %tmp5, %tmp2
9 %tmp13 = add i32 %b, %a
10 br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock
11
12cond_true:
13 %tmp15 = add i32 %tmp13, %c
14 %tmp1821 = sub i32 %tmp15, %d
15 ret i32 %tmp1821
16
17UnifiedReturnBlock:
18 ret i32 %tmp13
19}
20
21define i32 @t2(i32 %a, i32 %b, i32 %c, i32 %d) {
Evan Cheng86050dc2010-06-18 23:09:54 +000022; CHECK: t2:
23; CHECK: bxgt lr
24; CHECK: cmp
25; CHECK: addge
26; CHECK: subge
27; CHECK-NOT: bxge lr
28; CHECK: bx lr
Evan Cheng60c916b2007-06-20 18:26:15 +000029 %tmp2 = icmp sgt i32 %c, 10
30 %tmp5 = icmp slt i32 %d, 4
31 %tmp8 = and i1 %tmp5, %tmp2
32 %tmp13 = add i32 %b, %a
33 br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock
34
35cond_true:
36 %tmp15 = add i32 %tmp13, %c
37 %tmp1821 = sub i32 %tmp15, %d
38 ret i32 %tmp1821
39
40UnifiedReturnBlock:
41 ret i32 %tmp13
42}