1 ; RUN: opt < %s -passes=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, ptr blockaddress(@callee_indr_branch, %if.then), ptr blockaddress(@callee_indr_branch, %if.end)
8 indirectbr ptr %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(ptr)
25 declare void @llvm.localescape(...)
26 declare ptr @llvm.frameaddress(i32)
27 declare ptr @llvm.localrecover(ptr, ptr, i32)
31 define i32 @callee_frameescape(i32 %v) {
34 call void (...) @llvm.localescape(ptr %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