blob: 3a7a9752e5074ffefb344c88ae28ac9e145ab063 [file] [log] [blame]
Xinliang David Li66bdfca2017-05-12 23:41:43 +00001; RUN: opt < %s -skip-partial-inlining-cost-analysis -partial-inliner -S | FileCheck %s
2; RUN: opt < %s -skip-partial-inlining-cost-analysis -passes=partial-inliner -S | FileCheck %s
3
4define i32 @Func(i1 %cond, i32* align 4 %align.val) !prof !1 {
5; CHECK: @Func({{.*}}) !prof [[REMAINCOUNT:![0-9]+]]
6entry:
7 br i1 %cond, label %if.then, label %return
8if.then:
9 ; Dummy store to have more than 0 uses
10 store i32 10, i32* %align.val, align 4
11 br label %return
12return: ; preds = %entry
13 ret i32 0
14}
15
16define internal i32 @Caller1(i1 %cond, i32* align 2 %align.val) !prof !3{
17entry:
18; CHECK-LABEL: @Caller1
19; CHECK: br
20; CHECK: call void @Func.1_
21; CHECK: br
22; CHECK: call void @Func.1_
23 %val = call i32 @Func(i1 %cond, i32* %align.val)
24 %val2 = call i32 @Func(i1 %cond, i32* %align.val)
25 ret i32 %val
26}
27
28define internal i32 @Caller2(i1 %cond, i32* align 2 %align.val) !prof !2{
29entry:
30; CHECK-LABEL: @Caller2
31; CHECK: br
32; CHECK: call void @Func.1_
33 %val = call i32 @Func(i1 %cond, i32* %align.val)
34 ret i32 %val
35}
36
37; CHECK: [[REMAINCOUNT]] = !{!"function_entry_count", i64 150}
38!1 = !{!"function_entry_count", i64 200}
39!2 = !{!"function_entry_count", i64 10}
40!3 = !{!"function_entry_count", i64 20}
41