• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S < %s  -partial-inliner -partial-inlining-extra-penalty=2000 | FileCheck %s
2; RUN: opt -S < %s  -passes=partial-inliner -partial-inlining-extra-penalty=2000 | FileCheck %s
3define i32 @outline_region_notlikely(i32* %arg) local_unnamed_addr {
4bb:
5;  ptr != null is predicted to be true
6  %tmp = icmp ne i32* %arg, null
7  br i1 %tmp, label %bb8, label %bb1, !prof !2
8
9; bb1 is not likely
10bb1:                                              ; preds = %bb
11  %tmp2 = tail call i32 @foo(i32* nonnull %arg)
12  %tmp3 = tail call i32 @foo(i32* nonnull %arg)
13  %tmp4 = tail call i32 @foo(i32* nonnull %arg)
14  %tmp5 = tail call i32 @foo(i32* nonnull %arg)
15  %tmp6 = tail call i32 @foo(i32* nonnull %arg)
16  %tmp7 = tail call i32 @foo(i32* nonnull %arg)
17  br label %bb8
18
19bb8:                                              ; preds = %bb1, %bb
20  %tmp9 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
21  ret i32 %tmp9
22}
23
24define i32 @dummy_caller(i32* %arg) local_unnamed_addr {
25; CHECK-LABEL: @dummy_caller
26  %tmp = call i32 @outline_region_notlikely(i32* %arg)
27  ret i32 %tmp
28 }
29
30
31; CHECK-LABEL: define internal void @outline_region_notlikely.1.bb1(i32* %arg) {
32; CHECK-NEXT: newFuncRoot:
33
34declare i32 @foo(i32 * %arg)
35
36!llvm.module.flags = !{!0}
37!llvm.ident = !{!1}
38
39!0 = !{i32 1, !"wchar_size", i32 4}
40!1 = !{!"clang version 5.0.0 (trunk 304489)"}
41!2 = !{!"branch_weights", i32 2000, i32 1}
42