2016-05-10 21:48:23 +08:00
|
|
|
; RUN: opt -module-summary %s -o %t1.bc
|
|
|
|
; RUN: opt -module-summary %p/Inputs/distributed_indexes.ll -o %t2.bc
|
|
|
|
; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc
|
|
|
|
; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-index %t.index.bc %t1.bc %t2.bc
|
|
|
|
; RUN: llvm-bcanalyzer -dump %t1.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND1
|
|
|
|
; RUN: llvm-bcanalyzer -dump %t2.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND2
|
|
|
|
|
|
|
|
; The backend index for this module contains summaries from itself and
|
|
|
|
; Inputs/distributed_indexes.ll, as it imports from the latter.
|
2017-12-16 08:18:12 +08:00
|
|
|
; We should import @g and alias @analias. While we don't import the aliasee
|
|
|
|
; directly (and therefore don't have a third COMBINED record from module
|
|
|
|
; id 1), we will have a VALUE_GUID for it (hence the 4 VALUE_GUID entries).
|
2016-05-10 21:48:23 +08:00
|
|
|
; BACKEND1: <MODULE_STRTAB_BLOCK
|
|
|
|
; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
|
|
|
|
; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'
|
|
|
|
; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK
|
|
|
|
; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK
|
|
|
|
; BACKEND1-NEXT: <VERSION
|
2021-09-24 08:57:16 +08:00
|
|
|
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND1-DAG: <VALUE_GUID op0={{.*}}
|
2021-09-23 07:25:33 +08:00
|
|
|
; BACKEND1-NEXT: <COMBINED {{.*}} op1=0
|
|
|
|
; BACKEND1-NEXT: <COMBINED {{.*}} op1=0
|
|
|
|
; BACKEND1-NEXT: <COMBINED {{.*}} op1=1
|
|
|
|
; BACKEND1-NEXT: <COMBINED_ALIAS {{.*}} op1=1
|
|
|
|
; BACKEND1-NEXT: <BLOCK_COUNT op0=4/>
|
2016-05-10 21:48:23 +08:00
|
|
|
; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK
|
|
|
|
|
|
|
|
; The backend index for Input/distributed_indexes.ll contains summaries from
|
|
|
|
; itself only, as it does not import anything.
|
|
|
|
; BACKEND2: <MODULE_STRTAB_BLOCK
|
|
|
|
; BACKEND2-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp2.bc'
|
|
|
|
; BACKEND2-NEXT: </MODULE_STRTAB_BLOCK
|
|
|
|
; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK
|
|
|
|
; BACKEND2-NEXT: <VERSION
|
2021-09-24 08:57:16 +08:00
|
|
|
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
|
|
|
|
; BACKEND2-DAG: <VALUE_GUID op0={{.*}}
|
2016-05-10 21:48:23 +08:00
|
|
|
; BACKEND2-NEXT: <COMBINED
|
2017-12-16 08:18:12 +08:00
|
|
|
; BACKEND2-NEXT: <COMBINED
|
|
|
|
; BACKEND2-NEXT: <COMBINED_ALIAS
|
2021-09-23 07:25:33 +08:00
|
|
|
; BACKEND2-NEXT: <BLOCK_COUNT op0=4/>
|
2016-05-10 21:48:23 +08:00
|
|
|
; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK
|
|
|
|
|
2018-07-03 09:11:43 +08:00
|
|
|
; Make sure that when the alias is imported as a copy of the aliasee, but the
|
|
|
|
; aliasee is not being imported by itself, that we can still print the summary.
|
|
|
|
; The aliasee should be "null".
|
|
|
|
; RUN: llvm-dis %t1.bc.thinlto.bc -o - | FileCheck %s --check-prefix=DIS
|
|
|
|
; DIS: aliasee: null
|
|
|
|
|
[ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols
Summary:
Reapply r357931 with fixes to ThinLTO testcases and llvm-lto tool.
ThinLTOCodeGenerator currently does not preserve llvm.used symbols and
it can internalize them. In order to pass the necessary information to the
legacy ThinLTOCodeGenerator, the input to the code generator is
rewritten to be based on lto::InputFile.
Now ThinLTO using the legacy LTO API will requires data layout in
Module.
"internalize" thinlto action in llvm-lto is updated to run both
"promote" and "internalize" with the same configuration as
ThinLTOCodeGenerator. The old "promote" + "internalize" option does not
produce the same output as ThinLTOCodeGenerator.
This fixes: PR41236
rdar://problem/49293439
Reviewers: tejohnson, pcc, kromanova, dexonsmith
Reviewed By: tejohnson
Subscribers: ormris, bd1976llvm, mehdi_amini, inglorion, eraman, hiraditya, jkorous, dexonsmith, arphaman, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60421
llvm-svn: 358601
2019-04-18 01:38:09 +08:00
|
|
|
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
|
2016-05-10 21:48:23 +08:00
|
|
|
declare void @g(...)
|
2017-12-16 08:18:12 +08:00
|
|
|
declare void @analias(...)
|
2016-05-10 21:48:23 +08:00
|
|
|
|
|
|
|
define void @f() {
|
|
|
|
entry:
|
|
|
|
call void (...) @g()
|
2017-12-16 08:18:12 +08:00
|
|
|
call void (...) @analias()
|
2016-05-10 21:48:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
2021-09-23 07:25:33 +08:00
|
|
|
|
|
|
|
; Ensure we don't get a COMBINED_ORIGINAL_NAME record in the distributed index.
|
|
|
|
; The BACKEND1-NEXT checks would fail if we did.
|
|
|
|
define internal void @x() {
|
|
|
|
ret void
|
|
|
|
}
|