blob: 8e362080dc48ebc97d65249c036653a024db8f76 [file] [log] [blame]
Xinliang David Li66bdfca2017-05-12 23:41:43 +00001; RUN: opt < %s -partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis -S | FileCheck %s
Sean Silvaf8015752016-08-02 02:15:45 +00002
3; This test checks to make sure that CodeExtractor updates
4; the exit branch probabilities for multiple exit blocks.
5
6define i32 @inlinedFunc(i1 %cond) !prof !1 {
7entry:
8 br i1 %cond, label %if.then, label %return, !prof !2
9if.then:
10 br i1 %cond, label %return, label %return.2, !prof !3
11return.2:
12 ret i32 10
13return: ; preds = %entry
14 ret i32 0
15}
16
17
18define internal i32 @dummyCaller(i1 %cond) !prof !1 {
19entry:
20%val = call i32 @inlinedFunc(i1 %cond)
21ret i32 %val
22
23; CHECK-LABEL: @dummyCaller
24; CHECK: call
Xinliang David Lid21601a2017-04-27 16:34:00 +000025; CHECK-NEXT: br i1 {{.*}}return.i{{.*}}return.2{{.*}}!prof [[COUNT1:![0-9]+]]
Sean Silvaf8015752016-08-02 02:15:45 +000026}
27
28!llvm.module.flags = !{!0}
29!0 = !{i32 1, !"MaxFunctionCount", i32 10000}
30!1 = !{!"function_entry_count", i64 10000}
31!2 = !{!"branch_weights", i32 5, i32 5}
32!3 = !{!"branch_weights", i32 4, i32 1}
33
Xinliang David Lid21601a2017-04-27 16:34:00 +000034; CHECK: [[COUNT1]] = !{!"branch_weights", i32 31, i32 8}