Dehao Chen | fed890e | 2017-03-31 15:59:52 +0000 | [diff] [blame^] | 1 | ; RUN: opt -instcombine -inline -S -inline-threshold=0 -hot-callsite-threshold=100 < %s | FileCheck %s |
| 2 | ; Checks if VP profile is used for hotness checks in inlining after instcombine |
| 3 | ; converted the call to a direct call. |
| 4 | |
| 5 | declare void @bar(i16 *) |
| 6 | |
| 7 | define void @foo(i16* %a) { |
| 8 | call void @bar(i16* %a) |
| 9 | call void @bar(i16* %a) |
| 10 | ret void |
| 11 | } |
| 12 | |
| 13 | ; CHECK-LABEL: @test() |
| 14 | ; CHECK-NEXT: call void @bar |
| 15 | ; CHECK-NEXT: call void @bar |
| 16 | define void @test() { |
| 17 | call void bitcast (void (i16*)* @foo to void (i8*)*) (i8* null), !prof !0 |
| 18 | ret void |
| 19 | } |
| 20 | |
| 21 | !0 = !{!"VP", i32 0, i64 2000, i64 -3913987384944532146, i64 2000} |
| 22 | |
| 23 | !llvm.module.flags = !{!1} |
| 24 | |
| 25 | !1 = !{i32 1, !"ProfileSummary", !2} |
| 26 | !2 = !{!3, !4, !5, !6, !7, !8, !9, !10} |
| 27 | !3 = !{!"ProfileFormat", !"InstrProf"} |
| 28 | !4 = !{!"TotalCount", i64 10000} |
| 29 | !5 = !{!"MaxCount", i64 1000} |
| 30 | !6 = !{!"MaxInternalCount", i64 1} |
| 31 | !7 = !{!"MaxFunctionCount", i64 1000} |
| 32 | !8 = !{!"NumCounts", i64 3} |
| 33 | !9 = !{!"NumFunctions", i64 3} |
| 34 | !10 = !{!"DetailedSummary", !11} |
| 35 | !11 = !{!12, !13, !14} |
| 36 | !12 = !{i32 10000, i64 1000, i32 1} |
| 37 | !13 = !{i32 999000, i64 1000, i32 1} |
| 38 | !14 = !{i32 999999, i64 1, i32 2} |