• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 | FileCheck %s
2
3; CHECK: _f
4; CHECK: adds
5; CHECK-NOT: cmp
6; CHECK: bleq _h
7
8define i32 @f(i32 %a, i32 %b) nounwind ssp {
9entry:
10  %add = add nsw i32 %b, %a
11  %cmp = icmp eq i32 %add, 0
12  br i1 %cmp, label %if.then, label %if.end
13
14if.then:                                          ; preds = %entry
15  tail call void (...) @h(i32 %a, i32 %b) nounwind
16  br label %if.end
17
18if.end:                                           ; preds = %if.then, %entry
19  ret i32 %add
20}
21
22; CHECK: _g
23; CHECK: orrs
24; CHECK-NOT: cmp
25; CHECK: bleq _h
26
27define i32 @g(i32 %a, i32 %b) nounwind ssp {
28entry:
29  %add = or i32 %b, %a
30  %cmp = icmp eq i32 %add, 0
31  br i1 %cmp, label %if.then, label %if.end
32
33if.then:                                          ; preds = %entry
34  tail call void (...) @h(i32 %a, i32 %b) nounwind
35  br label %if.end
36
37if.end:                                           ; preds = %if.then, %entry
38  ret i32 %add
39}
40
41declare void @h(...)
42