mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
c19c96e06f
Summary: This is a companion patch for http://reviews.llvm.org/D16124. Internalized symbols increase the size of strongly-connected components in SCC-based module splitting and thus reduce the amount of parallelism. This patch records the original linkage of non-local symbols prior to internalization and then restores it just before splitting/CodeGen. This is also useful for cases where the linker requires symbols to remain external, for instance, so they can be placed according to linker script rules. It's currently under its own flag (-restore-globals) but should eventually share a common flag with D16124. Reviewers: joker.eph, pcc Subscribers: slarin, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D16229 llvm-svn: 258100
25 lines
500 B
LLVM
25 lines
500 B
LLVM
; Check that "internalizedfn" is re-externalized prior to CodeGen when
|
|
; setShouldRestoreGlobalsLinkage is enabled.
|
|
;
|
|
; RUN: llvm-as < %s > %t1
|
|
; RUN: llvm-lto -exported-symbol=preservedfn -restore-linkage -filetype=asm -o - %t1 | FileCheck %s
|
|
;
|
|
; CHECK: .globl internalizedfn
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
declare void @f()
|
|
|
|
define void @internalizedfn() noinline {
|
|
entry:
|
|
call void @f()
|
|
ret void
|
|
}
|
|
|
|
define void @preservedfn() {
|
|
entry:
|
|
call void @internalizedfn()
|
|
ret void
|
|
}
|
|
|