1 ; RUN: opt -S < %s -partial-inliner -partial-inlining-extra-penalty=10 | FileCheck %s
2 ; RUN: opt -S < %s -passes=partial-inliner -partial-inlining-extra-penalty=10 | FileCheck %s
3 define i32 @outline_region_notlikely(i32* %arg) local_unnamed_addr {
5 ; ptr != null is predicted to be true
6 %tmp = icmp ne i32* %arg, null
7 br i1 %tmp, label %bb8, label %bb1
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)
19 bb8: ; preds = %bb1, %bb
20 %tmp9 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
24 define i32 @outline_region_likely(i32* %arg) local_unnamed_addr {
26 ; ptr == null is predicted to be false
27 %tmp = icmp eq i32* %arg, null
28 br i1 %tmp, label %bb8, label %bb1
32 %tmp2 = tail call i32 @foo(i32* nonnull %arg)
33 %tmp3 = tail call i32 @foo(i32* nonnull %arg)
34 %tmp4 = tail call i32 @foo(i32* nonnull %arg)
35 %tmp5 = tail call i32 @foo(i32* nonnull %arg)
36 %tmp6 = tail call i32 @foo(i32* nonnull %arg)
37 %tmp7 = tail call i32 @foo(i32* nonnull %arg)
40 bb8: ; preds = %bb1, %bb
41 %tmp9 = phi i32 [ 0, %bb1 ], [ 1, %bb ]
45 declare i32 @foo(i32* %arg)
47 define i32 @dummy_caller(i32* %arg) local_unnamed_addr {
48 ; CHECK-LABEL: @dummy_caller
49 %tmp = call i32 @outline_region_notlikely(i32* %arg)
50 ; CHECK: call void @outline_region_notlikely.2.bb1
51 %tmp2 = tail call i32 @outline_region_likely(i32* %arg)
52 ; CHECK: %tmp2 = tail call i32 @outline_region_likely(i32* %arg)
57 ; CHECK-LABEL: define internal void @outline_region_notlikely.2.bb1(i32* %arg) {
58 ; CHECK-NEXT: newFuncRoot:
60 !llvm.module.flags = !{!0}
63 !0 = !{i32 1, !"wchar_size", i32 4}
64 !1 = !{!"clang version 5.0.0 (trunk 304489)"}