1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Revert "Move metadata linking after lazy global materialization/linking."

This reverts commit r251926. I believe this is causing an LTO
bootstrapping bot failure
(http://lab.llvm.org:8080/green/job/llvm-stage2-cmake-RgLTO_build/3669/).

Haven't been able to repro it yet, but after looking at the metadata I
am pretty sure I know what is going on.

llvm-svn: 251965
This commit is contained in:
Teresa Johnson 2015-11-03 19:36:04 +00:00
parent 7d3b847175
commit 93fae75d76
3 changed files with 9 additions and 34 deletions

View File

@ -1940,6 +1940,15 @@ bool ModuleLinker::run() {
linkGlobalValueBody(Src);
}
// Remap all of the named MDNodes in Src into the DstM module. We do this
// after linking GlobalValues so that MDNodes that reference GlobalValues
// are properly remapped.
linkNamedMDNodes();
// Merge the module flags into the DstM module.
if (linkModuleFlagsMetadata())
return true;
// Update the initializers in the DstM module now that all globals that may
// be referenced are in DstM.
for (GlobalVariable &Src : SrcM->globals()) {
@ -1966,15 +1975,6 @@ bool ModuleLinker::run() {
return true;
}
// Remap all of the named MDNodes in Src into the DstM module. We do this
// after linking GlobalValues so that MDNodes that reference GlobalValues
// are properly remapped.
linkNamedMDNodes();
// Merge the module flags into the DstM module.
if (linkModuleFlagsMetadata())
return true;
return false;
}

View File

@ -1,9 +0,0 @@
@X = external global i32
declare i32 @foo()
define void @bar() {
load i32, i32* @X
call i32 @foo()
ret void
}

View File

@ -1,16 +0,0 @@
; RUN: llvm-as %S/only-needed-named-metadata.ll -o %t.bc
; RUN: llvm-as %S/Inputs/only-needed-named-metadata.ll -o %t2.bc
; RUN: llvm-link -S -only-needed %t2.bc %t.bc | FileCheck %s
; RUN: llvm-link -S -internalize -only-needed %t2.bc %t.bc | FileCheck %s
; CHECK: @U = external global i32
; CHECK: declare i32 @unused()
@X = global i32 5
@U = global i32 6
define i32 @foo() { ret i32 7 }
define i32 @unused() { ret i32 8 }
!llvm.named = !{!0, !1}
!0 = !{i32 ()* @unused}
!1 = !{i32* @U}