1 ; RUN: opt -S < %s -passes=partial-inliner -partial-inlining-extra-penalty=10 | FileCheck %s
2 define i32 @outline_region_notlikely(ptr %arg) local_unnamed_addr {
4 ; ptr != null is predicted to be true
5 %tmp = icmp ne ptr %arg, null
6 br i1 %tmp, label %bb8, label %bb1
10 %tmp2 = tail call i32 @foo(ptr nonnull %arg)
11 %tmp3 = tail call i32 @foo(ptr nonnull %arg)
12 %tmp4 = tail call i32 @foo(ptr nonnull %arg)
13 %tmp5 = tail call i32 @foo(ptr nonnull %arg)
14 %tmp6 = tail call i32 @foo(ptr nonnull %arg)
15 %tmp7 = tail call i32 @foo(ptr nonnull %arg)
18 bb8: ; preds = %bb1, %bb
19 %tmp9 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
23 define i32 @outline_region_likely(ptr %arg) local_unnamed_addr {
25 ; ptr == null is predicted to be false
26 %tmp = icmp eq ptr %arg, null
27 br i1 %tmp, label %bb8, label %bb1
31 %tmp2 = tail call i32 @foo(ptr nonnull %arg)
32 %tmp3 = tail call i32 @foo(ptr nonnull %arg)
33 %tmp4 = tail call i32 @foo(ptr nonnull %arg)
34 %tmp5 = tail call i32 @foo(ptr nonnull %arg)
35 %tmp6 = tail call i32 @foo(ptr nonnull %arg)
36 %tmp7 = tail call i32 @foo(ptr nonnull %arg)
39 bb8: ; preds = %bb1, %bb
40 %tmp9 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
44 declare i32 @foo(ptr %arg)
46 define i32 @dummy_caller(ptr %arg) local_unnamed_addr {
47 ; CHECK-LABEL: @dummy_caller
48 %tmp = call i32 @outline_region_notlikely(ptr %arg)
49 ; CHECK: call void @outline_region_notlikely.2.bb1
50 %tmp2 = tail call i32 @outline_region_likely(ptr %arg)
51 ; CHECK: %tmp2 = tail call i32 @outline_region_likely(ptr %arg)
56 ; CHECK-LABEL: define internal void @outline_region_notlikely.2.bb1(ptr %arg) {
57 ; CHECK-NEXT: newFuncRoot:
59 !llvm.module.flags = !{!0}
62 !0 = !{i32 1, !"wchar_size", i32 4}
63 !1 = !{!"clang version 5.0.0 (trunk 304489)"}