1 ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
4 define i32 @callee_indr_branch(i32 %v) {
6 %cmp = icmp sgt i32 %v, 2000
7 %addr = select i1 %cmp, i8* blockaddress(@callee_indr_branch, %if.then), i8* blockaddress(@callee_indr_branch, %if.end)
8 indirectbr i8* %addr, [ label %if.then, label %if.end]
10 if.then: ; preds = %entry
11 %mul = mul nsw i32 %v, 10
18 if.end: ; preds = %if.then, %entry
19 %v2 = phi i32 [ %v, %entry ], [ %mul, %if.then2 ]
20 %add = add nsw i32 %v2, 200
24 declare void @use_fp(i8 *)
25 declare void @llvm.localescape(...)
26 declare i8* @llvm.frameaddress(i32)
27 declare i8* @llvm.localrecover(i8*, i8*, i32)
31 define i32 @callee_frameescape(i32 %v) {
34 call void (...) @llvm.localescape(i32* %a)
35 %cmp = icmp sgt i32 %v, 2000
36 br i1 %cmp, label %if.then, label %if.end
38 if.then: ; preds = %entry
39 %mul = mul nsw i32 %v, 10
46 if.end: ; preds = %if.then, %entry
47 %v2 = phi i32 [ %v, %entry ], [ %mul, %if.then2 ]
48 %add = add nsw i32 %v2, 200
53 ; CHECK-LABEL: @caller
54 ; CHECK: %r1 = call i32 @callee_indr_branch(i32 %v)
55 ; CHECK-NEXT: %r2 = call i32 @callee_frameescape(i32 %v)
56 define i32 @caller(i32 %v) {
58 %r1 = call i32 @callee_indr_branch(i32 %v)
59 %r2 = call i32 @callee_frameescape(i32 %v)
60 %res = add i32 %r1, %r2