1 ; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s
3 ; Check that we do not overcompute the outlined region cost, where the PHIs in
4 ; the outlined region entry (BB4) are moved outside the region by CodeExtractor.
6 define i32 @bar(i32 %arg) {
8 %tmp = icmp slt i32 %arg, 0
9 br i1 %tmp, label %bb1, label %bb2
12 br i1 %tmp, label %bb4, label %bb2
14 bb2: ; preds = %bb, %bb1
15 br i1 %tmp, label %bb4, label %bb5
17 bb4: ; preds = %bb1, %bb2
18 %xx1 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
19 %xx2 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
20 %xx3 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
21 tail call void (...) @foo() #2
24 bb5: ; preds = %bb4, %bb2
25 %tmp6 = phi i32 [ 1, %bb2 ], [ 9, %bb4 ]
29 declare void @foo(...)
31 define i32 @dummy_caller(i32 %arg) {
33 ; CHECK-LABEL: @dummy_caller
36 ; CHECK: call void @bar.1.
37 %tmp = tail call i32 @bar(i32 %arg)