diff options
Diffstat (limited to 'test/Transforms/FunctionImport/Inputs')
3 files changed, 128 insertions, 0 deletions
diff --git a/test/Transforms/FunctionImport/Inputs/funcimport.ll b/test/Transforms/FunctionImport/Inputs/funcimport.ll index fa96b8ea2663..c4ef37a168f2 100644 --- a/test/Transforms/FunctionImport/Inputs/funcimport.ll +++ b/test/Transforms/FunctionImport/Inputs/funcimport.ll @@ -11,6 +11,7 @@ define void @globalfunc1() #0 { entry: call void @funcwithpersonality() + call void (...) @variadic() ret void } @@ -146,4 +147,8 @@ entry: ret void } +; Variadic function should not be imported because inliner doesn't handle it. +define void @variadic(...) { + ret void +} diff --git a/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll b/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll new file mode 100644 index 000000000000..6951b65818d5 --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/hotness_based_import.ll @@ -0,0 +1,81 @@ +; ModuleID = 'thinlto-function-summary-callgraph-profile-summary2.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + + +define void @hot1() #1 { + ret void +} +define void @hot2() #1 !prof !20 { + call void @calledFromHot() + call void @calledFromHot() + ret void +} +define void @hot3() #1 !prof !20 { + call void @calledFromHot() + call void @calledFromHot() + call void @calledFromHot() + ret void +} +define void @cold() #1 !prof !0 { + ret void +} +define void @cold2() #1 !prof !0 { + call void @calledFromCold() + call void @calledFromCold() + ret void +} + +define void @none1() #1 { + ret void +} + +define void @none2() #1 { + call void @calledFromNone() + ret void +} +define void @none3() #1 { + call void @calledFromNone() + call void @calledFromNone() + ret void +} + +define void @calledFromCold() { + ret void +} + +define void @calledFromHot() !prof !20 { + call void @calledFromHot2() + ret void +} + +define void @calledFromHot2() !prof !20 { + call void @calledFromHot3() + ret void +} + +define void @calledFromNone() !prof !0 { + ret void +} + +declare void @calledFromHot3() + +!0 = !{!"function_entry_count", i64 1} +!20 = !{!"function_entry_count", i64 110} + +!llvm.module.flags = !{!1} + +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 10000} +!5 = !{!"MaxCount", i64 10} +!6 = !{!"MaxInternalCount", i64 1} +!7 = !{!"MaxFunctionCount", i64 1000} +!8 = !{!"NumCounts", i64 3} +!9 = !{!"NumFunctions", i64 3} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12, !13, !14} +!12 = !{i32 10000, i64 100, i32 1} +!13 = !{i32 999000, i64 100, i32 1} +!14 = !{i32 999999, i64 1, i32 2}
\ No newline at end of file diff --git a/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll b/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll new file mode 100644 index 000000000000..4f17cb2cd9a1 --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll @@ -0,0 +1,42 @@ +; ModuleID = 'thinlto-function-summary-callgraph-profile-summary2.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + + +define void @hot() #1 !prof !28 { + call void @calledFromHot() + ret void +} + +; 9 instructions so it is above decayed cold threshold of 7 and below +; decayed hot threshold of 10. +define void @calledFromHot() !prof !28 { + %b = alloca i32, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + store i32 1, i32* %b, align 4 + ret void +} + +!llvm.module.flags = !{!1} + +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 222} +!5 = !{!"MaxCount", i64 110} +!6 = !{!"MaxInternalCount", i64 1} +!7 = !{!"MaxFunctionCount", i64 110} +!8 = !{!"NumCounts", i64 4} +!9 = !{!"NumFunctions", i64 3} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12, !13, !14} +!12 = !{i32 10000, i64 110, i32 2} +!13 = !{i32 999000, i64 2, i32 4} +!14 = !{i32 999999, i64 2, i32 4} +!28 = !{!"function_entry_count", i64 110} +!29 = !{!"function_entry_count", i64 1} |
