diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
| commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
| tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /test/Transforms/FunctionImport | |
| parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) | |
Notes
Diffstat (limited to 'test/Transforms/FunctionImport')
15 files changed, 264 insertions, 99 deletions
diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_cutoff.ll b/test/Transforms/FunctionImport/Inputs/funcimport_cutoff.ll new file mode 100644 index 000000000000..4283215d74c9 --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/funcimport_cutoff.ll @@ -0,0 +1,9 @@ +define void @foo() { +entry: + ret void +} + +define void @bar() { +entry: + ret void +} diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll b/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll index 0e75924cd3b6..f553af41896f 100644 --- a/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll +++ b/test/Transforms/FunctionImport/Inputs/funcimport_debug.ll @@ -17,7 +17,7 @@ attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fp !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255685) (llvm/trunk 255682)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) !1 = !DIFile(filename: "funcimport_debug.c", directory: ".") !2 = !{} -!4 = distinct !DISubprogram(name: "func", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2) +!4 = distinct !DISubprogram(name: "func", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_forcecold.ll b/test/Transforms/FunctionImport/Inputs/funcimport_forcecold.ll new file mode 100644 index 000000000000..a59d68c1e186 --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/funcimport_forcecold.ll @@ -0,0 +1,4 @@ +define void @foo() { +entry: + ret void +} diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_resolved1.ll b/test/Transforms/FunctionImport/Inputs/funcimport_resolved1.ll new file mode 100644 index 000000000000..2b2443c96afe --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/funcimport_resolved1.ll @@ -0,0 +1,34 @@ +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +define void @foo() { + call void @linkonceodrfunc() + call void @linkonceodrfunc2() + ret void +} + +define linkonce_odr void @linkonceodrfunc() { + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + ret void +} + +define linkonce_odr void @linkonceodrfunc2() { + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + call void @f() + ret void +} + +define internal void @f() { + ret void +} diff --git a/test/Transforms/FunctionImport/Inputs/funcimport_resolved2.ll b/test/Transforms/FunctionImport/Inputs/funcimport_resolved2.ll new file mode 100644 index 000000000000..278a7f4553fe --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/funcimport_resolved2.ll @@ -0,0 +1,6 @@ +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +define linkonce_odr void @linkonceodrfunc() { + ret void +} diff --git a/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll b/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll deleted file mode 100644 index 4f17cb2cd9a1..000000000000 --- a/test/Transforms/FunctionImport/Inputs/hotness_based_import2.ll +++ /dev/null @@ -1,42 +0,0 @@ -; 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} diff --git a/test/Transforms/FunctionImport/Inputs/not-prevailing.ll b/test/Transforms/FunctionImport/Inputs/not-prevailing.ll new file mode 100644 index 000000000000..ca17d7f377c7 --- /dev/null +++ b/test/Transforms/FunctionImport/Inputs/not-prevailing.ll @@ -0,0 +1,6 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define weak i32 @foo() { + ret i32 0 +} diff --git a/test/Transforms/FunctionImport/funcimport.ll b/test/Transforms/FunctionImport/funcimport.ll index 4ff51a33b5e6..bb974b587e39 100644 --- a/test/Transforms/FunctionImport/funcimport.ll +++ b/test/Transforms/FunctionImport/funcimport.ll @@ -7,7 +7,8 @@ ; RUN: opt -function-import -stats -print-imports -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF ; Try again with new pass manager ; RUN: opt -passes='function-import' -stats -print-imports -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF -; "-stats" requires +Asserts. +; RUN: opt -passes='function-import' -debug-only=function-import -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=DUMP +; "-stats" and "-debug-only" require +Asserts. ; REQUIRES: asserts ; Test import with smaller instruction limit @@ -80,7 +81,7 @@ declare void @callfuncptr(...) #1 ; Ensure that all uses of local variable @P which has used in setfuncptr ; and callfuncptr are to the same promoted/renamed global. -; CHECK-DAG: @P.llvm.{{.*}} = external hidden global void ()* +; CHECK-DAG: @P.llvm.{{.*}} = available_externally hidden global void ()* null ; CHECK-DAG: %0 = load void ()*, void ()** @P.llvm. ; CHECK-DAG: store void ()* @staticfunc2.llvm.{{.*}}, void ()** @P.llvm. @@ -107,6 +108,8 @@ declare void @variadic(...) ; INSTLIMDEF-DAG: Import globalfunc2 ; INSTLIMDEF-DAG: 13 function-import - Number of functions imported +; INSTLIMDEF-DAG: 4 function-import - Number of global variables imported + ; CHECK-DAG: !0 = !{!"{{.*}}/Inputs/funcimport.ll"} ; The actual GUID values will depend on path to test. @@ -142,3 +145,9 @@ declare void @variadic(...) ; GUID-DAG: GUID {{.*}} is linkoncealias ; GUID-DAG: GUID {{.*}} is callfuncptr ; GUID-DAG: GUID {{.*}} is linkoncefunc + +; DUMP: Module [[M1:.*]] imports from 1 module +; DUMP-NEXT: 13 functions imported from [[M2:.*]] +; DUMP-NEXT: 4 vars imported from [[M2]] +; DUMP: Imported 13 functions for Module [[M1]] +; DUMP-NEXT: Imported 4 global variables for Module [[M1]] diff --git a/test/Transforms/FunctionImport/funcimport_cutoff.ll b/test/Transforms/FunctionImport/funcimport_cutoff.ll new file mode 100644 index 000000000000..dac4bd14faa7 --- /dev/null +++ b/test/Transforms/FunctionImport/funcimport_cutoff.ll @@ -0,0 +1,49 @@ +; Test to ensure that thin linking with -import-cutoff stops importing when +; expected. + +; "-stats" and "-debug-only" require +Asserts. +; REQUIRES: asserts + +; RUN: opt -module-summary %s -o %t.bc +; RUN: opt -module-summary %p/Inputs/funcimport_cutoff.ll -o %t2.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc + +; First do with default options, which should import both foo and bar +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT + +; Next try to restrict to 1 import. This should import just foo. +; RUN: opt -import-cutoff=1 -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT1 + +; Next try to restrict to 0 imports. This should not import. +; RUN: opt -import-cutoff=0 -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT + +define i32 @main() { +entry: + call void @foo() + call void @bar() + ret i32 0 +} + +declare void @foo() +declare void @bar() + +; Check -print-imports output +; IMPORT: Import foo +; IMPORT: Import bar +; IMPORT1: Import foo +; IMPORT1-NOT: Import bar +; NOIMPORT-NOT: Import foo +; NOIMPORT-NOT: Import bar + +; Check -S output +; IMPORT-DAG: define available_externally void @foo() +; IMPORT-DAG: define available_externally void @bar() +; NOIMPORT-DAG: declare void @foo() +; NOIMPORT-DAG: declare void @bar() +; IMPORT1-DAG: define available_externally void @foo() +; IMPORT1-DAG: declare void @bar() + +; Check -stats output +; IMPORT: 2 function-import - Number of functions imported +; IMPORT1: 1 function-import - Number of functions imported +; NOIMPORT-NOT: function-import - Number of functions imported diff --git a/test/Transforms/FunctionImport/funcimport_debug.ll b/test/Transforms/FunctionImport/funcimport_debug.ll index e7c6389e90a5..e764d78c300c 100644 --- a/test/Transforms/FunctionImport/funcimport_debug.ll +++ b/test/Transforms/FunctionImport/funcimport_debug.ll @@ -42,7 +42,7 @@ attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no- !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255685) (llvm/trunk 255682)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) !1 = !DIFile(filename: "funcimport_debug.c", directory: ".") !2 = !{} -!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/Transforms/FunctionImport/funcimport_forcecold.ll b/test/Transforms/FunctionImport/funcimport_forcecold.ll new file mode 100644 index 000000000000..a9aa77f9afe8 --- /dev/null +++ b/test/Transforms/FunctionImport/funcimport_forcecold.ll @@ -0,0 +1,36 @@ +; Test to ensure that building summary with -force-summary-edges-cold +; blocks importing as expected. + +; "-stats" and "-debug-only" require +Asserts. +; REQUIRES: asserts + +; First do with default options, which should import +; RUN: opt -module-summary %s -o %t.bc +; RUN: opt -module-summary %p/Inputs/funcimport_forcecold.ll -o %t2.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT + +; Next rebuild caller module summary with non-critical edges forced cold (which +; should affect all edges in this test as we don't have any sample pgo). +; Make sure we don't import. +; RUN: opt -force-summary-edges-cold=all-non-critical -module-summary %s -o %t.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT + +; Next rebuild caller module summary with all edges forced cold. +; Make sure we don't import. +; RUN: opt -force-summary-edges-cold=all -module-summary %s -o %t.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT + +define i32 @main() { +entry: + call void @foo() + ret i32 0 +} + +; IMPORT: Import foo +; NOIMPORT-NOT: Import foo +; IMPORT: define available_externally void @foo() +; NOIMPORT: declare void @foo() +declare void @foo() diff --git a/test/Transforms/FunctionImport/funcimport_forcecold_samplepgo.ll b/test/Transforms/FunctionImport/funcimport_forcecold_samplepgo.ll new file mode 100644 index 000000000000..4ff02b9ba0ff --- /dev/null +++ b/test/Transforms/FunctionImport/funcimport_forcecold_samplepgo.ll @@ -0,0 +1,37 @@ +; Test to ensure that building summary with -force-summary-edges-cold +; blocks importing as expected. + +; "-stats" and "-debug-only" require +Asserts. +; REQUIRES: asserts + +; First do with default options, which should import +; RUN: opt -module-summary %s -o %t.bc +; RUN: opt -module-summary %p/Inputs/funcimport_forcecold.ll -o %t2.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT + +; Next rebuild caller module summary with only non-critical edges forced cold, +; which should still import in this case. +; RUN: opt -force-summary-edges-cold=all-non-critical -module-summary %s -o %t.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT + +; Next rebuild caller module summary with all edges forced cold. +; Make sure we don't import. +; RUN: opt -force-summary-edges-cold=all -module-summary %s -o %t.bc +; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc +; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT + +define i32 @main() !prof !1 { +entry: + call void @foo() + ret i32 0 +} + +; IMPORT: Import foo +; NOIMPORT-NOT: Import foo +; IMPORT: define available_externally void @foo() +; NOIMPORT: declare void @foo() +declare void @foo() + +!1 = !{!"function_entry_count", i64 110, i64 6699318081062747564} diff --git a/test/Transforms/FunctionImport/funcimport_resolved.ll b/test/Transforms/FunctionImport/funcimport_resolved.ll new file mode 100644 index 000000000000..b256a613602d --- /dev/null +++ b/test/Transforms/FunctionImport/funcimport_resolved.ll @@ -0,0 +1,52 @@ +; Test to ensure that we always select the same copy of a linkonce function +; when it is encountered with different thresholds. When we encounter the +; copy in funcimport_resolved1.ll with a higher threshold via the direct call +; from main(), it will be selected for importing. When we encounter it with a +; lower threshold by reaching it from the deeper call chain via foo(), it +; won't be selected for importing. We don't want to select both the copy from +; funcimport_resolved1.ll and the smaller one from funcimport_resolved2.ll, +; leaving it up to the backend to figure out which one to actually import. +; The linkonce_odr may have different instruction counts in practice due to +; different inlines in the compile step. + +; Require asserts so we can use -debug-only +; REQUIRES: asserts + +; REQUIRES: x86-registered-target + +; RUN: opt -module-summary %s -o %t.bc +; RUN: opt -module-summary %p/Inputs/funcimport_resolved1.ll -o %t2.bc +; RUN: opt -module-summary %p/Inputs/funcimport_resolved2.ll -o %t3.bc + +; First do a sanity check that all callees are imported with the default +; instruction limit +; RUN: llvm-lto2 run %t.bc %t2.bc %t3.bc -o %t4 -r=%t.bc,_main,pl -r=%t.bc,_linkonceodrfunc,l -r=%t.bc,_foo,l -r=%t2.bc,_foo,pl -r=%t2.bc,_linkonceodrfunc,pl -r=%t2.bc,_linkonceodrfunc2,pl -r=%t3.bc,_linkonceodrfunc,l -thinlto-threads=1 -debug-only=function-import 2>&1 | FileCheck %s --check-prefix=INSTLIMDEFAULT +; INSTLIMDEFAULT: Is importing function {{.*}} foo from {{.*}}funcimport_resolved1.ll +; INSTLIMDEFAULT: Is importing function {{.*}} linkonceodrfunc from {{.*}}funcimport_resolved1.ll +; INSTLIMDEFAULT: Is importing function {{.*}} linkonceodrfunc2 from {{.*}}funcimport_resolved1.ll +; INSTLIMDEFAULT: Is importing function {{.*}} f from {{.*}}funcimport_resolved1.ll +; INSTLIMDEFAULT-NOT: Is importing function {{.*}} linkonceodrfunc from {{.*}}funcimport_resolved2.ll + +; Now run with the lower threshold that will only allow linkonceodrfunc to be +; imported from funcimport_resolved1.ll when encountered via the direct call +; from main(). Ensure we don't also select the copy in funcimport_resolved2.ll +; when it is encountered via the deeper call chain. +; RUN: llvm-lto2 run %t.bc %t2.bc %t3.bc -o %t4 -r=%t.bc,_main,pl -r=%t.bc,_linkonceodrfunc,l -r=%t.bc,_foo,l -r=%t2.bc,_foo,pl -r=%t2.bc,_linkonceodrfunc,pl -r=%t2.bc,_linkonceodrfunc2,pl -r=%t3.bc,_linkonceodrfunc,l -thinlto-threads=1 -debug-only=function-import -import-instr-limit=8 2>&1 | FileCheck %s --check-prefix=INSTLIM8 +; INSTLIM8: Is importing function {{.*}} foo from {{.*}}funcimport_resolved1.ll +; INSTLIM8: Is importing function {{.*}} linkonceodrfunc from {{.*}}funcimport_resolved1.ll +; INSTLIM8: Not importing function {{.*}} linkonceodrfunc2 from {{.*}}funcimport_resolved1.ll +; INSTLIM8: Is importing function {{.*}} f from {{.*}}funcimport_resolved1.ll +; INSTLIM8-NOT: Is importing function {{.*}} linkonceodrfunc from {{.*}}funcimport_resolved2.ll + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +define i32 @main() #0 { +entry: + call void (...) @foo() + call void (...) @linkonceodrfunc() + ret i32 0 +} + +declare void @foo(...) #1 +declare void @linkonceodrfunc(...) #1 diff --git a/test/Transforms/FunctionImport/hotness_based_import2.ll b/test/Transforms/FunctionImport/hotness_based_import2.ll deleted file mode 100644 index 50de33199f69..000000000000 --- a/test/Transforms/FunctionImport/hotness_based_import2.ll +++ /dev/null @@ -1,53 +0,0 @@ -; Test to check that callee reached from cold and then hot path gets -; hot thresholds. -; RUN: opt -module-summary %s -o %t.bc -; RUN: opt -module-summary %p/Inputs/hotness_based_import2.ll -o %t2.bc -; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc - -; Teset with limit set to 10 and multipliers set to 1. Since cold call to -; hot is first in the other module, we'll first add calledFromHot to worklist -; with threshold decayed by default 0.7 factor. Test ensures that when we -; encounter it again from hot path, we re-enqueue with higher non-decayed -; threshold which will allow it to be imported. -; RUN: opt -function-import -summary-file %t3.thinlto.bc %t.bc -import-instr-limit=10 -import-hot-multiplier=1.0 -import-cold-multiplier=1.0 -S | FileCheck %s --check-prefix=CHECK -; CHECK-DAG: define available_externally void @hot() -; CHECK-DAG: define available_externally void @calledFromHot() - -; ModuleID = 'thinlto-function-summary-callgraph.ll' -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; This function has a high profile count, so entry block is hot. -define void @hot_function(i1 %a, i1 %a2) !prof !28 { -entry: - call void @hot() - ret void -} - -; This function has a low profile count, so entry block is hot. -define void @cold_function(i1 %a, i1 %a2) !prof !29 { -entry: - call void @hot() - ret void -} - -declare void @hot() #1 - -!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} diff --git a/test/Transforms/FunctionImport/not-prevailing.ll b/test/Transforms/FunctionImport/not-prevailing.ll new file mode 100644 index 000000000000..0e8b35ca3420 --- /dev/null +++ b/test/Transforms/FunctionImport/not-prevailing.ll @@ -0,0 +1,18 @@ +; RUN: opt -module-summary %s -o %t1.bc +; RUN: opt -module-summary -o %t2.bc %S/Inputs/not-prevailing.ll +; RUN: not llvm-lto2 run -o %t3.bc %t1.bc %t2.bc -r %t1.bc,bar,px \ +; RUN: -r %t1.bc,foo,x -r %t2.bc,foo,x -save-temps 2>&1 | FileCheck %s + +; CHECK: Interposable and available_externally symbol + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define available_externally i32 @foo() { + ret i32 1 +} + +define i32 @bar() { + %1 = call i32 @foo() + ret i32 %1 +} |
