diff options
Diffstat (limited to 'llvm/test/Transforms/PGOProfile/Inputs')
34 files changed, 835 insertions, 0 deletions
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext b/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext new file mode 100644 index 00000000000..7ebc13cd128 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/PR28219.proftext @@ -0,0 +1,10 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +@bar +256 +1 +2 +@foo +512 +1 +3 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext new file mode 100644 index 00000000000..8ca9db9c051 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch1.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_br_1 +25571299074 +2 +3 +2 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext new file mode 100644 index 00000000000..a5b1f8204e8 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch1_large_count.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_br_1 +25571299074 +2 +12884901888 +8589934592 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext new file mode 100644 index 00000000000..b5fee2b6f4f --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/branch2.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_br_2 +29667547796 +2 +1 +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext new file mode 100644 index 00000000000..7613b643b16 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/criticaledge.proftext @@ -0,0 +1,19 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_criticalEdge +82323253069 +8 +2 +1 +2 +2 +0 +1 +2 +1 + +<stdin>:bar +12884901887 +1 +7 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext b/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext new file mode 100644 index 00000000000..e40a0f29fcc --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/cspgo.proftext @@ -0,0 +1,151 @@ +# CSIR level Instrumentation Flag +:csir +bar_m +# Func Hash: +29667547796 +# Num Counters: +2 +# Counter Values: +99949 +51 + +bar_m +# Func Hash: +1224979111529676799 +# Num Counters: +2 +# Counter Values: +100000 +99949 + +csfdo_plain.c:cond +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +200000 + +csfdo_plain.c:cond +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +200000 + +bar_m2 +# Func Hash: +1152921534274394772 +# Num Counters: +2 +# Counter Values: +99938 +62 + +bar_m2 +# Func Hash: +29667547796 +# Num Counters: +2 +# Counter Values: +99938 +62 + +foo +# Func Hash: +1152921640672869708 +# Num Counters: +10 +# Counter Values: +100000 +100000 +0 +66666 +66666 +0 +100000 +66667 +100000 +1 + +foo +# Func Hash: +29212902728 +# Num Counters: +2 +# Counter Values: +100000 +1 + +bar +# Func Hash: +1152921569533132113 +# Num Counters: +5 +# Counter Values: +0 +0 +0 +0 +0 + +bar +# Func Hash: +56228292833 +# Num Counters: +4 +# Counter Values: +800000 +399999 +100000 +100000 + +main +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +1 + +main +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +1 + +csfdo_plain.c:barbar +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +100000 + +csfdo_plain.c:barbar +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +100000 + +goo +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +100000 + +goo +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +100000 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/diag.proftext b/llvm/test/Transforms/PGOProfile/Inputs/diag.proftext new file mode 100644 index 00000000000..a38d7939ebd --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/diag.proftext @@ -0,0 +1,7 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +foo +12884999999 +1 +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/diag_FE.proftext b/llvm/test/Transforms/PGOProfile/Inputs/diag_FE.proftext new file mode 100644 index 00000000000..aaa137e3a42 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/diag_FE.proftext @@ -0,0 +1,5 @@ +foo +12884999999 +1 +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext new file mode 100644 index 00000000000..2dc2c2ec9f3 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/func_entry.proftext @@ -0,0 +1,17 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +9999 + +bar +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +0 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext new file mode 100644 index 00000000000..d453090d1c5 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext @@ -0,0 +1,43 @@ +:ir +bar +# Func Hash: +281487861612543 +# Num Counters: +1 +# Counter Values: +140 +# Num Value Kinds: +1 +# ValueKind = IPVK_IndirectCallTarget: +0 +# NumValueSites: +1 +3 +func2:80 +func1:40 +func3:20 + +func1 +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +40 + +func2 +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +80 + +func3 +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +20 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext new file mode 100644 index 00000000000..39099684762 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/indirectbr.proftext @@ -0,0 +1,12 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +47485104005 +# Num Counters: +4 +# Counter Values: +139 +20 +5 +63 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext b/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext new file mode 100644 index 00000000000..9b0210d9a30 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext @@ -0,0 +1,29 @@ +:ir +_Z11irreducibleii +# Func Hash: +64451410787 +# Num Counters: +6 +# Counter Values: +1000 +950 +100 +373 +1 +0 + +_Z11irreduciblePh +# Func Hash: +104649601521 +# Num Counters: +9 +# Counter Values: +100 +300 +99 +300 +201 +1 +1 +0 +0 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext b/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext new file mode 100644 index 00000000000..c71fd04170b --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/landingpad.proftext @@ -0,0 +1,16 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +foo +59130013419 +4 +3 +1 +2 +0 + +bar +24868915205 +2 +3 +2 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext b/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext new file mode 100644 index 00000000000..814af7402b2 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/large_count_remarks.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test +25571299074 +2 +40000000000 +20000000000 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext new file mode 100644 index 00000000000..c19737149ca --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop1.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_simple_for +34137660316 +2 +96 +4 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext new file mode 100644 index 00000000000..af3a71df1e6 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/loop2.proftext @@ -0,0 +1,9 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_nested_for +53929068288 +3 +33 +10 +6 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext b/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext new file mode 100644 index 00000000000..400b29df303 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/memop_size_annotation.proftext @@ -0,0 +1,27 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +53929068288 +# Num Counters: +3 +# Counter Values: +556 +20 +1 +# Num Value Kinds: +1 +# ValueKind = IPVK_MemOPSize: +1 +# NumValueSites: +1 +9 +7:33 +2:88 +9:72 +4:66 +1:99 +5:55 +6:44 +3:77 +8:22 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext b/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext new file mode 100644 index 00000000000..5bf67fb2bfa --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/multiple_hash_profile.proftext @@ -0,0 +1,36 @@ +# IR level Instrumentation Flag +:ir +_Z3fooi +# Func Hash: +72057606922829823 +# Num Counters: +2 +# Counter Values: +18 +12 + +_Z3fooi +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +0 + +_Z3bari +# Func Hash: +72057606922829823 +# Num Counters: +2 +# Counter Values: +0 +0 + +_Z4m2f1v +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext b/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext new file mode 100644 index 00000000000..1bedce5b9f9 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/noreturncall.proftext @@ -0,0 +1,11 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +36496524737 +# Num Counters: +3 +# Counter Values: +21 +21 +0 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/remap.map b/llvm/test/Transforms/PGOProfile/Inputs/remap.map new file mode 100644 index 00000000000..df3d82d38bd --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/remap.map @@ -0,0 +1,8 @@ +# foo:: and foo::detail:: are equivalent +name 3foo N3foo6detailE + +# foo::qux and foo::quux are equivalent +type N3foo3quxE N3foo4quuxE + +# N::X and M::X are equivalent +name N1N1XE N1M1XE diff --git a/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext b/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext new file mode 100644 index 00000000000..40054d78f5a --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/remap.proftext @@ -0,0 +1,8 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +_ZN3foo3barERKN1N1XINS_4quuxEEE +25571299074 +2 +3 +2 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext b/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext new file mode 100644 index 00000000000..be80acb5d12 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/select1.proftext @@ -0,0 +1,8 @@ +:ir +test_br_2 +72057623705475732 +3 +4 +1 +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext b/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext new file mode 100644 index 00000000000..56d78387ec2 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/select2.proftext @@ -0,0 +1,11 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +72057628175588252 +# Num Counters: +3 +# Counter Values: +800 +3 +300 diff --git a/llvm/test/Transforms/PGOProfile/Inputs/select_hash_conflict.proftext b/llvm/test/Transforms/PGOProfile/Inputs/select_hash_conflict.proftext new file mode 100644 index 00000000000..ccc3b803fc8 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/select_hash_conflict.proftext @@ -0,0 +1,10 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +1 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext b/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext new file mode 100644 index 00000000000..bebd65fa4c9 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/switch.proftext @@ -0,0 +1,10 @@ +# :ir is the flag to indicate this is IR level profile. +:ir +test_switch +46200943743 +4 +0 +5 +2 +3 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext new file mode 100644 index 00000000000..4717752da71 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cs.proftext @@ -0,0 +1,72 @@ +# CSIR level Instrumentation Flag +:csir +cond.llvm.11253644763537639171 +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +200000 + +foo +# Func Hash: +29212902728 +# Num Counters: +2 +# Counter Values: +100000 +1 + +bar +# Func Hash: +1152921534274394772 +# Num Counters: +2 +# Counter Values: +0 +0 + +bar +# Func Hash: +29667547796 +# Num Counters: +2 +# Counter Values: +100000 +100000 + +main +# Func Hash: +1152921517491748863 +# Num Counters: +1 +# Counter Values: +1 + +main +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +1 + +cspgo.c:foo +# Func Hash: +1152921563228422740 +# Num Counters: +4 +# Counter Values: +100000 +100000 +0 +1 + +cspgo_bar.c:cond +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +200000 + diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll new file mode 100644 index 00000000000..bec04c6a3c8 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll @@ -0,0 +1,74 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +$__llvm_profile_filename = comdat any +$__llvm_profile_raw_version = comdat any + +@odd = common dso_local global i32 0, align 4 +@even = common dso_local global i32 0, align 4 +@__llvm_profile_filename = constant [25 x i8] c"pass2/default_%m.profraw\00", comdat +@__llvm_profile_raw_version = constant i64 216172782113783812, comdat + +define dso_local void @bar(i32 %n) !prof !29 { +entry: + %call = tail call fastcc i32 @cond(i32 %n) + %tobool = icmp eq i32 %call, 0 + br i1 %tobool, label %if.else, label %if.then, !prof !30 + +if.then: + %0 = load i32, i32* @odd, align 4 + %inc = add i32 %0, 1 + store i32 %inc, i32* @odd, align 4 + br label %if.end + +if.else: + %1 = load i32, i32* @even, align 4 + %inc1 = add i32 %1, 1 + store i32 %inc1, i32* @even, align 4 + br label %if.end + +if.end: + ret void +} + +define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 { +entry: + %rem = srem i32 %i, 2 + ret i32 %rem +} + +attributes #1 = { inlinehint noinline } + +!llvm.module.flags = !{!0, !1} + +!0 = !{i32 1, !"wchar_size", i32 4} +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 500002} +!5 = !{!"MaxCount", i64 200000} +!6 = !{!"MaxInternalCount", i64 100000} +!7 = !{!"MaxFunctionCount", i64 200000} +!8 = !{!"NumCounts", i64 6} +!9 = !{!"NumFunctions", i64 4} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27} +!12 = !{i32 10000, i64 200000, i32 1} +!13 = !{i32 100000, i64 200000, i32 1} +!14 = !{i32 200000, i64 200000, i32 1} +!15 = !{i32 300000, i64 200000, i32 1} +!16 = !{i32 400000, i64 200000, i32 1} +!17 = !{i32 500000, i64 100000, i32 4} +!18 = !{i32 600000, i64 100000, i32 4} +!19 = !{i32 700000, i64 100000, i32 4} +!20 = !{i32 800000, i64 100000, i32 4} +!21 = !{i32 900000, i64 100000, i32 4} +!22 = !{i32 950000, i64 100000, i32 4} +!23 = !{i32 990000, i64 100000, i32 4} +!24 = !{i32 999000, i64 100000, i32 4} +!25 = !{i32 999900, i64 100000, i32 4} +!26 = !{i32 999990, i64 100000, i32 4} +!27 = !{i32 999999, i64 1, i32 6} +!29 = !{!"function_entry_count", i64 200000} +!30 = !{!"branch_weights", i32 100000, i32 100000} +!35 = !{!"cspgo_bar.c:cond"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll new file mode 100644 index 00000000000..01617221590 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll @@ -0,0 +1,70 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@odd = common dso_local global i32 0, align 4 +@even = common dso_local global i32 0, align 4 + +define dso_local void @bar(i32 %n) #0 !prof !29 { +entry: + %call = tail call fastcc i32 @cond(i32 %n) + %tobool = icmp eq i32 %call, 0 + br i1 %tobool, label %if.else, label %if.then, !prof !30 + +if.then: + %0 = load i32, i32* @odd, align 4 + %inc = add i32 %0, 1 + store i32 %inc, i32* @odd, align 4 + br label %if.end + +if.else: + %1 = load i32, i32* @even, align 4 + %inc1 = add i32 %1, 1 + store i32 %inc1, i32* @even, align 4 + br label %if.end + +if.end: + ret void +} + +define internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 { +entry: + %rem = srem i32 %i, 2 + ret i32 %rem +} + +attributes #0 = { "target-cpu"="x86-64" } +attributes #1 = { inlinehint noinline } + +!llvm.module.flags = !{!0, !1} + +!0 = !{i32 1, !"wchar_size", i32 4} +!1 = !{i32 1, !"ProfileSummary", !2} +!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} +!3 = !{!"ProfileFormat", !"InstrProf"} +!4 = !{!"TotalCount", i64 500002} +!5 = !{!"MaxCount", i64 200000} +!6 = !{!"MaxInternalCount", i64 100000} +!7 = !{!"MaxFunctionCount", i64 200000} +!8 = !{!"NumCounts", i64 6} +!9 = !{!"NumFunctions", i64 4} +!10 = !{!"DetailedSummary", !11} +!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27} +!12 = !{i32 10000, i64 200000, i32 1} +!13 = !{i32 100000, i64 200000, i32 1} +!14 = !{i32 200000, i64 200000, i32 1} +!15 = !{i32 300000, i64 200000, i32 1} +!16 = !{i32 400000, i64 200000, i32 1} +!17 = !{i32 500000, i64 100000, i32 4} +!18 = !{i32 600000, i64 100000, i32 4} +!19 = !{i32 700000, i64 100000, i32 4} +!20 = !{i32 800000, i64 100000, i32 4} +!21 = !{i32 900000, i64 100000, i32 4} +!22 = !{i32 950000, i64 100000, i32 4} +!23 = !{i32 990000, i64 100000, i32 4} +!24 = !{i32 999000, i64 100000, i32 4} +!25 = !{i32 999900, i64 100000, i32 4} +!26 = !{i32 999990, i64 100000, i32 4} +!27 = !{i32 999999, i64 1, i32 6} +!29 = !{!"function_entry_count", i64 200000} +!30 = !{!"branch_weights", i32 100000, i32 100000} +!35 = !{!"cspgo_bar.c:cond"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_indirect_call_promotion.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_indirect_call_promotion.ll new file mode 100644 index 00000000000..8732e540767 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_indirect_call_promotion.ll @@ -0,0 +1,16 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +source_filename = "thinlto_indirect_call_promotion.c" + +define void @a() { +entry: + ret void +} + +define internal void @c() !PGOFuncName !1 { +entry: + ret void +} + +!1 = !{!"thinlto_indirect_call_promotion.c:c"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll new file mode 100644 index 00000000000..22860f52b5d --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll @@ -0,0 +1,27 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@fptr = external local_unnamed_addr global void ()*, align 8 + +; Function Attrs: norecurse nounwind uwtable +define void @_Z6updatei(i32 %i) local_unnamed_addr #0 { +entry: + store void ()* @_ZL3foov, void ()** @fptr, align 8 + ret void +} + +; Function Attrs: norecurse nounwind readnone uwtable +define internal void @_ZL3foov() #1 { +entry: + ret void +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3} +!llvm.ident = !{!31} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) +!1 = !DIFile(filename: "b.cc", directory: "/ssd/llvm/abc/small") +!2 = !{} +!3 = !{i32 2, !"Debug Info Version", i32 3} +!31 = !{!"clang version 5.0.0 (trunk 297016)"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2a.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2a.ll new file mode 100644 index 00000000000..545b36c1180 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2a.ll @@ -0,0 +1,21 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: norecurse nounwind readnone uwtable +define internal void @_ZL3foov() #1 { +entry: + call void @_ZL3barv() + ret void +} + +declare void @_ZL3barv() + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3} +!llvm.ident = !{!31} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) +!1 = !DIFile(filename: "b.cc", directory: "/ssd/llvm/abc/small") +!2 = !{} +!3 = !{i32 2, !"Debug Info Version", i32 3} +!31 = !{!"clang version 5.0.0 (trunk 297016)"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2b.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2b.ll new file mode 100644 index 00000000000..f8de10c4d0d --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2b.ll @@ -0,0 +1,28 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @_ZL3barv() #1 { +entry: + call void @dummy() + call void @dummy() + call void @dummy() + call void @dummy() + call void @dummy() + call void @dummy() + ret void +} + +define internal void @dummy() { +entry: + ret void +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3} +!llvm.ident = !{!31} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) +!1 = !DIFile(filename: "c.cc", directory: "/ssd/llvm/abc/small") +!2 = !{} +!3 = !{i32 2, !"Debug Info Version", i32 3} +!31 = !{!"clang version 5.0.0 (trunk 297016)"} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll new file mode 100644 index 00000000000..10d633be59f --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll @@ -0,0 +1,31 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@fptr = external local_unnamed_addr global void ()*, align 8 + +; Function Attrs: norecurse nounwind uwtable +define void @_Z6updatei(i32 %i) local_unnamed_addr #0 { +entry: + store void ()* @_ZL3foov, void ()** @fptr, align 8 + ret void +} + +; Function Attrs: nounwind readnone uwtable +define internal void @_ZL3foov() !prof !34 { +entry: + %0 = load void ()*, void ()** @fptr, align 8 + tail call void %0(), !prof !40 + ret void +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3} +!llvm.ident = !{!31} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) +!1 = !DIFile(filename: "b.cc", directory: "/ssd/llvm/abc/small") +!2 = !{} +!3 = !{i32 2, !"Debug Info Version", i32 3} +!31 = !{!"clang version 5.0.0 (trunk 297016)"} +!34 = !{!"function_entry_count", i64 1} +!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000} diff --git a/llvm/test/Transforms/PGOProfile/Inputs/unreachable_bb.proftext b/llvm/test/Transforms/PGOProfile/Inputs/unreachable_bb.proftext new file mode 100644 index 00000000000..58f2cc82598 --- /dev/null +++ b/llvm/test/Transforms/PGOProfile/Inputs/unreachable_bb.proftext @@ -0,0 +1,9 @@ +# IR level Instrumentation Flag +:ir +foo +# Func Hash: +12884901887 +# Num Counters: +1 +# Counter Values: +0 |

