Easwaran Raman | 12585b0 | 2017-01-20 22:44:04 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -passes='require<profile-summary>,cgscc(inline)' -S | FileCheck %s |
| 2 | |
| 3 | ; This tests that the function count of a callee gets correctly updated after it |
| 4 | ; has been inlined into a two callsites. |
| 5 | |
| 6 | ; CHECK: @callee() !prof [[COUNT:![0-9]+]] |
| 7 | define i32 @callee() !prof !1 { |
| 8 | ret i32 0 |
| 9 | } |
| 10 | |
| 11 | define i32 @caller1() !prof !2 { |
| 12 | ; CHECK-LABEL: @caller1 |
| 13 | ; CHECK-NOT: callee |
| 14 | ; CHECK: ret |
| 15 | %i = call i32 @callee() |
| 16 | ret i32 %i |
| 17 | } |
| 18 | |
| 19 | define i32 @caller2() !prof !3 { |
| 20 | ; CHECK-LABEL: @caller2 |
| 21 | ; CHECK-NOT: callee |
| 22 | ; CHECK: ret |
| 23 | %i = call i32 @callee() |
| 24 | ret i32 %i |
| 25 | } |
| 26 | |
| 27 | !llvm.module.flags = !{!0} |
| 28 | ; CHECK: [[COUNT]] = !{!"function_entry_count", i64 0} |
| 29 | !0 = !{i32 1, !"MaxFunctionCount", i32 1000} |
| 30 | !1 = !{!"function_entry_count", i64 1000} |
| 31 | !2 = !{!"function_entry_count", i64 600} |
| 32 | !3 = !{!"function_entry_count", i64 400} |
| 33 | |