diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-01-08 14:17:41 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-01-08 14:17:41 +0000 |
commit | a1080ee6f0a2e80a911b1a3c5215b584669fcd87 (patch) | |
tree | 6fb38bd8f9851795091de46deeff99a62ceaee7b /llvm/test/Transforms/FunctionImport/funcimport_debug.ll | |
parent | 10595a1739cb193c58d485ebc5780d9f679e94a4 (diff) | |
download | bcm5719-llvm-a1080ee6f0a2e80a911b1a3c5215b584669fcd87.tar.gz bcm5719-llvm-a1080ee6f0a2e80a911b1a3c5215b584669fcd87.zip |
[ThinLTO] Delay metadata materializtion in function importer
The function importer was still materializing metadata when modules were
loaded for function importing. We only want to materialize it when we
are going to invoke the metadata linking postpass. Materializing it
before function importing is not only unnecessary, but also causes
metadata referenced by imported functions to be mapped in early, and
then not connected to the rest of the module level metadata when it is
ultimately linked in.
Augmented the test case to specifically check for the metadata being
properly connected, which it wasn't before this fix.
llvm-svn: 257171
Diffstat (limited to 'llvm/test/Transforms/FunctionImport/funcimport_debug.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionImport/funcimport_debug.ll | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/test/Transforms/FunctionImport/funcimport_debug.ll b/llvm/test/Transforms/FunctionImport/funcimport_debug.ll index c57b5e14af1..96b73a3f6bc 100644 --- a/llvm/test/Transforms/FunctionImport/funcimport_debug.ll +++ b/llvm/test/Transforms/FunctionImport/funcimport_debug.ll @@ -7,8 +7,18 @@ ; RUN: opt -function-import -summary-file %t3.thinlto.bc %s -S | FileCheck %s ; CHECK: define available_externally void @func() -; CHECK: distinct !DISubprogram(name: "main" -; CHECK: distinct !DISubprogram(name: "func" + +; Check that we have exactly two subprograms (that func's subprogram wasn't +; linked more than once for example), and that they are connected to +; the subprogram list on a compute unit. +; CHECK: !{{[0-9]+}} = distinct !DICompileUnit({{.*}} subprograms: ![[SPs1:[0-9]+]] +; CHECK: ![[SPs1]] = !{![[MAINSP:[0-9]+]]} +; CHECK: ![[MAINSP]] = distinct !DISubprogram(name: "main" +; CHECK: !{{[0-9]+}} = distinct !DICompileUnit({{.*}} subprograms: ![[SPs2:[0-9]+]] +; CHECK-NOT: ![[SPs2]] = !{{{.*}}null{{.*}}} +; CHECK: ![[SPs2]] = !{![[FUNCSP:[0-9]+]]} +; CHECK: ![[FUNCSP]] = distinct !DISubprogram(name: "func" +; CHECK-NOT: distinct !DISubprogram ; ModuleID = 'funcimport_debug.o' target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |