50 lines · plain
1; RUN: opt < %s -passes=partial-inliner -S 2>&1| FileCheck %s2 3define i32 @callee1(i32 %arg) {4bb:5 %tmp = icmp slt i32 %arg, 06 br i1 %tmp, label %bb1, label %bb27 8bb1:9 br i1 %tmp, label %bb4, label %bb210 11bb2:12 br i1 %tmp, label %bb4, label %bb513 14bb4: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() #219 br label %bb520 21bb5:22 %tmp6 = phi i32 [ 1, %bb2 ], [ 9, %bb4 ]23 ret i32 %tmp624}25 26declare void @extern(...)27 28define i32 @caller1(i32 %arg) {29bb:30;; partial inliner inlines callee to caller.31; CHECK-LABEL: @caller132; CHECK: br i133; CHECK: br i134; CHECK-NOT: call i32 @callee1(35 %tmp = tail call i32 @callee1(i32 %arg)36 ret i32 %tmp37}38 39define i32 @caller2(i32 %arg) #0 {40bb:41;; partial inliner won't inline callee to caller because they have42;; incompatible attributes.43; CHECK-LABEL: @caller244; CHECK: call i32 @callee1(45 %tmp = tail call i32 @callee1(i32 %arg)46 ret i32 %tmp47}48 49attributes #0 = { "use-sample-profile" }50