diff options
author | Easwaran Raman <eraman@google.com> | 2016-04-15 21:39:58 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2016-04-15 21:39:58 +0000 |
commit | f53baca686583eedf2c76bfbe3cbf88e1428fe26 (patch) | |
tree | a0df56353026c1fef7374206da006a1858f7f4cd /llvm/test | |
parent | a283ddc5159ab3e2bb1cc1deea641b958de82075 (diff) | |
download | bcm5719-llvm-f53baca686583eedf2c76bfbe3cbf88e1428fe26.tar.gz bcm5719-llvm-f53baca686583eedf2c76bfbe3cbf88e1428fe26.zip |
Replace the use of MaxFunctionCount module flag
Adds an interface to get ProfileSummary for a module and makes InlineCost use ProfileSummary to get max function count.
Differential Revision: http://reviews.llvm.org/D18622
llvm-svn: 266477
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/Inline/inline-cold-callee.ll | 27 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/inline-hot-callee.ll | 27 |
2 files changed, 38 insertions, 16 deletions
diff --git a/llvm/test/Transforms/Inline/inline-cold-callee.ll b/llvm/test/Transforms/Inline/inline-cold-callee.ll index 1fd9f105db5..0543a5a9cd6 100644 --- a/llvm/test/Transforms/Inline/inline-cold-callee.ll +++ b/llvm/test/Transforms/Inline/inline-cold-callee.ll @@ -5,7 +5,7 @@ ; A callee with identical body does gets inlined because cost fits within the ; inline-threshold -define i32 @callee1(i32 %x) !prof !1 { +define i32 @callee1(i32 %x) !prof !21 { %x1 = add i32 %x, 1 %x2 = add i32 %x1, 1 %x3 = add i32 %x2, 1 @@ -13,7 +13,7 @@ define i32 @callee1(i32 %x) !prof !1 { ret i32 %x3 } -define i32 @callee2(i32 %x) !prof !2 { +define i32 @callee2(i32 %x) !prof !22 { ; CHECK-LABEL: @callee2( %x1 = add i32 %x, 1 %x2 = add i32 %x1, 1 @@ -22,7 +22,7 @@ define i32 @callee2(i32 %x) !prof !2 { ret i32 %x3 } -define i32 @caller2(i32 %y1) !prof !2 { +define i32 @caller2(i32 %y1) !prof !22 { ; CHECK-LABEL: @caller2( ; CHECK: call i32 @callee2 ; CHECK-NOT: call i32 @callee1 @@ -32,8 +32,19 @@ define i32 @caller2(i32 %y1) !prof !2 { ret i32 %y3 } -!llvm.module.flags = !{!0} -!0 = !{i32 1, !"MaxFunctionCount", i32 1000} -!1 = !{!"function_entry_count", i64 100} -!2 = !{!"function_entry_count", i64 1} - +!llvm.module.flags = !{!1} +!21 = !{!"function_entry_count", i64 100} +!22 = !{!"function_entry_count", i64 1} + +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 10000} +!5 = !{!"MaxBlockCount", i64 1000} +!6 = !{!"MaxInternalBlockCount", i64 1} +!7 = !{!"MaxFunctionCount", i64 1000} +!8 = !{!"NumBlocks", i64 3} +!9 = !{!"NumFunctions", i64 3} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12} +!12 = !{i32 10000, i64 0, i32 0} diff --git a/llvm/test/Transforms/Inline/inline-hot-callee.ll b/llvm/test/Transforms/Inline/inline-hot-callee.ll index 93ea9d43c78..905625e286d 100644 --- a/llvm/test/Transforms/Inline/inline-hot-callee.ll +++ b/llvm/test/Transforms/Inline/inline-hot-callee.ll @@ -5,7 +5,7 @@ ; A cold callee with identical body does not get inlined because cost exceeds the ; inline-threshold -define i32 @callee1(i32 %x) !prof !1 { +define i32 @callee1(i32 %x) !prof !20 { %x1 = add i32 %x, 1 %x2 = add i32 %x1, 1 %x3 = add i32 %x2, 1 @@ -13,7 +13,7 @@ define i32 @callee1(i32 %x) !prof !1 { ret i32 %x3 } -define i32 @callee2(i32 %x) !prof !2 { +define i32 @callee2(i32 %x) !prof !21 { ; CHECK-LABEL: @callee2( %x1 = add i32 %x, 1 %x2 = add i32 %x1, 1 @@ -22,7 +22,7 @@ define i32 @callee2(i32 %x) !prof !2 { ret i32 %x3 } -define i32 @caller2(i32 %y1) !prof !2 { +define i32 @caller2(i32 %y1) !prof !21 { ; CHECK-LABEL: @caller2( ; CHECK: call i32 @callee2 ; CHECK-NOT: call i32 @callee1 @@ -32,8 +32,19 @@ define i32 @caller2(i32 %y1) !prof !2 { ret i32 %y3 } -!llvm.module.flags = !{!0} -!0 = !{i32 1, !"MaxFunctionCount", i32 10} -!1 = !{!"function_entry_count", i64 10} -!2 = !{!"function_entry_count", i64 1} - +!llvm.module.flags = !{!1} +!20 = !{!"function_entry_count", i64 10} +!21 = !{!"function_entry_count", i64 1} + +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 10000} +!5 = !{!"MaxBlockCount", i64 10} +!6 = !{!"MaxInternalBlockCount", i64 1} +!7 = !{!"MaxFunctionCount", i64 10} +!8 = !{!"NumBlocks", i64 3} +!9 = !{!"NumFunctions", i64 3} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12} +!12 = !{i32 10000, i64 0, i32 0} |