mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
b3b970744d
Imported functions and variable get the visibility from the module supplying the definition. However, non-imported definitions do not get the visibility from (ELF) the most constraining visibility among all modules (Mach-O) the visibility of the prevailing definition. This patch * adds visibility bits to GlobalValueSummary::GVFlags * computes the result visibility and propagates it to all definitions Protected/hidden can imply dso_local which can enable some optimizations (this is stronger than GVFlags::DSOLocal because the implied dso_local can be leveraged for ELF -shared while default visibility dso_local has to be cleared for ELF -shared). Note: we don't have summaries for declarations, so for ELF if a declaration has the most constraining visibility, the result visibility may not be that one. Differential Revision: https://reviews.llvm.org/D92900
19 lines
752 B
LLVM
19 lines
752 B
LLVM
; RUN: llvm-as %s -o %t.o
|
|
; RUN: llvm-cat -b -o %t2.o %t.o %t.o
|
|
; RUN: llvm-dis -o %t3 %t2.o
|
|
; RUN: llvm-as -o %t4.o %t3.0
|
|
; RUN: llvm-as -o %t5.o %t3.1
|
|
; RUN: cmp %t4.o %t5.o
|
|
; RUN: llvm-cat -b -o %t6.o %t5.o %t4.o
|
|
; RUN: llvm-dis -o %t7.o %t6.o
|
|
; RUN: diff %t7.o.0 %t7.o.1
|
|
; RUN: FileCheck < %t7.o.0 %s
|
|
; RUN: FileCheck < %t7.o.1 %s
|
|
|
|
; ModuleID = 'multi-summary-disassemble.o'
|
|
|
|
^0 = module: (path: "multi-summary-disassemble.ll", hash: (1369602428, 2747878711, 259090915, 2507395659, 1141468049))
|
|
^1 = gv: (guid: 3, summaries: (function: (module: ^0, flags: (linkage: internal, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 1), insts: 1)))
|
|
; CHECK: ^0 = module: (path:
|
|
; CHECK: ^1 = gv: (guid: 3, summaries: (function: (module: ^0,
|