1 ; RUN: opt < %s -partial-inliner -S | FileCheck %s
2 ; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s
4 ; Check that we do not overcompute the outlined region cost, where the PHIs in
5 ; the outlined region entry (BB4) are moved outside the region by CodeExtractor.
7 define i32 @bar(i32 %arg) {
9 %tmp = icmp slt i32 %arg, 0
10 br i1 %tmp, label %bb1, label %bb2
13 br i1 undef, label %bb4, label %bb2
15 bb2: ; preds = %bb, %bb1
16 br i1 undef, label %bb4, label %bb5
18 bb4: ; preds = %bb1, %bb2
19 %xx1 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
20 %xx2 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
21 %xx3 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
22 tail call void (...) @foo() #2
25 bb5: ; preds = %bb4, %bb2
26 %tmp6 = phi i32 [ 1, %bb2 ], [ 9, %bb4 ]
30 declare void @foo(...)
32 define i32 @dummy_caller(i32 %arg) {
34 ; CHECK-LABEL: @dummy_caller
37 ; CHECK: call void @bar.1.
38 %tmp = tail call i32 @bar(i32 %arg)