• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -partial-inliner -S | FileCheck %s
2; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s
3; RUN: opt < %s -partial-inliner -max-num-inline-blocks=3 -S | FileCheck --check-prefix=LIMIT %s
4; RUN: opt < %s -passes=partial-inliner -max-num-inline-blocks=3 -S | FileCheck  --check-prefix=LIMIT %s
5
6; Function Attrs: nounwind uwtable
7define i32 @bar(i32 %arg) local_unnamed_addr #0 {
8bb:
9  %tmp = icmp slt i32 %arg, 0
10  br i1 %tmp, label %bb1, label %bb4
11
12bb1:                                              ; preds = %bb
13  %tmp2 = tail call i32 (...) @n() #2
14  %tmp3 = icmp slt i32 %tmp2, %arg
15  br i1 %tmp3, label %bb7, label %bb4
16
17bb4:                                              ; preds = %bb1, %bb
18  %tmp5 = tail call i32 (...) @m() #2
19  %tmp6 = icmp slt i32 %tmp5, %arg
20  br i1 %tmp6, label %bb7, label %bb8
21
22bb7:                                              ; preds = %bb4, %bb1
23  tail call void (...) @foo() #2
24  tail call void (...) @foo() #2
25  tail call void (...) @foo() #2
26  tail call void (...) @foo() #2
27  tail call void (...) @foo() #2
28  tail call void (...) @foo() #2
29  tail call void (...) @foo() #2
30  tail call void (...) @foo() #2
31  tail call void (...) @foo() #2
32  br label %bb8
33
34bb8:                                              ; preds = %bb7, %bb4
35  %tmp9 = phi i32 [ 0, %bb7 ], [ 1, %bb4 ]
36  ret i32 %tmp9
37}
38
39declare i32 @n(...) local_unnamed_addr #1
40
41declare i32 @m(...) local_unnamed_addr #1
42
43declare void @foo(...) local_unnamed_addr #1
44
45; Function Attrs: nounwind uwtable
46define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
47bb:
48; CHECK-LABEL: @dummy_caller
49; CHECK: br i1
50; CHECK: br i1
51; CHECK: br i1
52; CHECK: call void @bar.1.
53; LIMIT-LABEL: @dummy_caller
54; LIMIT-NOT: br i1
55; LIMIT: call i32 @bar
56  %tmp = tail call i32 @bar(i32 %arg)
57  ret i32 %tmp
58}
59
60attributes #0 = { nounwind }
61attributes #1 = { nounwind }
62attributes #2 = { nounwind }
63
64