1 ; RUN: opt < %s -passes=partial-inliner -S 2>&1| FileCheck %s
3 define i32 @callee1(i32 %arg) {
5 %tmp = icmp slt i32 %arg, 0
6 br i1 %tmp, label %bb1, label %bb2
9 br i1 undef, label %bb4, label %bb2
12 br i1 undef, label %bb4, label %bb5
15 %xx1 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
16 %xx2 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
17 %xx3 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
18 tail call void (...) @extern() #2
22 %tmp6 = phi i32 [ 1, %bb2 ], [ 9, %bb4 ]
26 declare void @extern(...)
28 define i32 @caller1(i32 %arg) {
30 ;; partial inliner inlines callee to caller.
31 ; CHECK-LABEL: @caller1
34 ; CHECK-NOT: call i32 @callee1(
35 %tmp = tail call i32 @callee1(i32 %arg)
39 define i32 @caller2(i32 %arg) #0 {
41 ;; partial inliner won't inline callee to caller because they have
42 ;; incompatible attributes.
43 ; CHECK-LABEL: @caller2
44 ; CHECK: call i32 @callee1(
45 %tmp = tail call i32 @callee1(i32 %arg)
49 attributes #0 = { "use-sample-profile" }