summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/GlobalValue.h12
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp13
-rw-r--r--llvm/lib/IR/AsmWriter.cpp12
-rw-r--r--llvm/lib/IR/Verifier.cpp5
-rw-r--r--llvm/lib/Target/TargetMachine.cpp2
-rw-r--r--llvm/lib/Transforms/Coroutines/CoroSplit.cpp1
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp1
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-refgraph.ll2
-rw-r--r--llvm/test/Bitcode/thinlto-summary-linkage-types.ll4
-rw-r--r--llvm/test/Bitcode/thinlto-summary-section.ll6
-rw-r--r--llvm/test/CodeGen/AMDGPU/enqueue-kernel.ll4
-rw-r--r--llvm/test/LTO/Resolution/X86/comdat.ll2
-rw-r--r--llvm/test/Linker/funcimport.ll18
-rw-r--r--llvm/test/Other/extract.ll4
-rw-r--r--llvm/test/ThinLTO/X86/alias_import.ll6
-rw-r--r--llvm/test/ThinLTO/X86/deadstrip.ll12
-rw-r--r--llvm/test/ThinLTO/X86/export.ll4
-rw-r--r--llvm/test/ThinLTO/X86/funcimport.ll10
-rw-r--r--llvm/test/ThinLTO/X86/internalize.ll4
-rw-r--r--llvm/test/ThinLTO/X86/local_name_conflict.ll4
-rw-r--r--llvm/test/ThinLTO/X86/referenced_by_constant.ll8
-rw-r--r--llvm/test/Transforms/FunctionImport/funcimport.ll8
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll8
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll4
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll4
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll8
-rw-r--r--llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll4
-rw-r--r--llvm/test/tools/gold/X86/coff.ll2
-rw-r--r--llvm/test/tools/gold/X86/emit-llvm.ll2
-rw-r--r--llvm/test/tools/gold/X86/global_with_section.ll10
-rw-r--r--llvm/test/tools/llvm-split/internal.ll4
-rw-r--r--llvm/test/tools/llvm-split/preserve-locals.ll2
-rw-r--r--llvm/test/tools/llvm-split/scc-alias.ll4
-rw-r--r--llvm/test/tools/llvm-split/scc-callchain.ll6
-rw-r--r--llvm/test/tools/llvm-split/scc-comdat.ll4
-rw-r--r--llvm/test/tools/llvm-split/scc-constants.ll4
-rw-r--r--llvm/test/tools/llvm-split/scc-cycle.ll4
-rw-r--r--llvm/test/tools/llvm-split/scc-global2global.ll4
-rw-r--r--llvm/test/tools/llvm-split/unnamed.ll8
39 files changed, 122 insertions, 102 deletions
diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h
index 1793de7887f..7823eefecdc 100644
--- a/llvm/include/llvm/IR/GlobalValue.h
+++ b/llvm/include/llvm/IR/GlobalValue.h
@@ -77,11 +77,12 @@ protected:
GlobalValue(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps,
LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace)
: Constant(PointerType::get(Ty, AddressSpace), VTy, Ops, NumOps),
- ValueType(Ty), Linkage(Linkage), Visibility(DefaultVisibility),
+ ValueType(Ty), Visibility(DefaultVisibility),
UnnamedAddrVal(unsigned(UnnamedAddr::None)),
DllStorageClass(DefaultStorageClass), ThreadLocal(NotThreadLocal),
- HasLLVMReservedName(false), IsDSOLocal(false),
- IntID((Intrinsic::ID)0U), Parent(nullptr) {
+ HasLLVMReservedName(false), IsDSOLocal(false), IntID((Intrinsic::ID)0U),
+ Parent(nullptr) {
+ setLinkage(Linkage);
setName(Name);
}
@@ -434,8 +435,11 @@ public:
}
void setLinkage(LinkageTypes LT) {
- if (isLocalLinkage(LT))
+ if (isLocalLinkage(LT)) {
Visibility = DefaultVisibility;
+ if (getValueID() != Value::GlobalIFuncVal)
+ setDSOLocal(true);
+ }
Linkage = LT;
}
LinkageTypes getLinkage() const { return LinkageTypes(Linkage); }
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index c3ab95550e0..6f425721c1b 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -715,6 +715,13 @@ static bool isValidVisibilityForLinkage(unsigned V, unsigned L) {
(GlobalValue::VisibilityTypes)V == GlobalValue::DefaultVisibility;
}
+// If there was an explicit dso_local, update GV. In the absence of an explicit
+// dso_local we keep the default value.
+static void maybeSetDSOLocal(bool DSOLocal, GlobalValue &GV) {
+ if (DSOLocal)
+ GV.setDSOLocal(true);
+}
+
/// parseIndirectSymbol:
/// ::= GlobalVar '=' OptionalLinkage OptionalPreemptionSpecifier
/// OptionalVisibility OptionalDLLStorageClass
@@ -826,7 +833,7 @@ bool LLParser::parseIndirectSymbol(const std::string &Name, LocTy NameLoc,
GA->setVisibility((GlobalValue::VisibilityTypes)Visibility);
GA->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass);
GA->setUnnamedAddr(UnnamedAddr);
- GA->setDSOLocal(DSOLocal);
+ maybeSetDSOLocal(DSOLocal, *GA);
if (Name.empty())
NumberedVals.push_back(GA.get());
@@ -947,7 +954,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
GV->setInitializer(Init);
GV->setConstant(IsConstant);
GV->setLinkage((GlobalValue::LinkageTypes)Linkage);
- GV->setDSOLocal(DSOLocal);
+ maybeSetDSOLocal(DSOLocal, *GV);
GV->setVisibility((GlobalValue::VisibilityTypes)Visibility);
GV->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass);
GV->setExternallyInitialized(IsExternallyInitialized);
@@ -4923,7 +4930,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
NumberedVals.push_back(Fn);
Fn->setLinkage((GlobalValue::LinkageTypes)Linkage);
- Fn->setDSOLocal(DSOLocal);
+ maybeSetDSOLocal(DSOLocal, *Fn);
Fn->setVisibility((GlobalValue::VisibilityTypes)Visibility);
Fn->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass);
Fn->setCallingConv(CC);
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 0fafe82404e..27a75927832 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -2497,8 +2497,10 @@ static void PrintVisibility(GlobalValue::VisibilityTypes Vis,
}
}
-static void PrintDSOLocation(bool IsDSOLocal, formatted_raw_ostream &Out){
- if (IsDSOLocal)
+static void PrintDSOLocation(const GlobalValue &GV,
+ formatted_raw_ostream &Out) {
+ // GVs with local linkage are implicitly dso_local, so we don't print it.
+ if (GV.isDSOLocal() && !GV.hasLocalLinkage())
Out << "dso_local ";
}
@@ -2572,7 +2574,7 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
Out << "external ";
Out << getLinkagePrintName(GV->getLinkage());
- PrintDSOLocation(GV->isDSOLocal(), Out);
+ PrintDSOLocation(*GV, Out);
PrintVisibility(GV->getVisibility(), Out);
PrintDLLStorageClass(GV->getDLLStorageClass(), Out);
PrintThreadLocalModel(GV->getThreadLocalMode(), Out);
@@ -2619,7 +2621,7 @@ void AssemblyWriter::printIndirectSymbol(const GlobalIndirectSymbol *GIS) {
Out << " = ";
Out << getLinkagePrintName(GIS->getLinkage());
- PrintDSOLocation(GIS->isDSOLocal(), Out);
+ PrintDSOLocation(*GIS, Out);
PrintVisibility(GIS->getVisibility(), Out);
PrintDLLStorageClass(GIS->getDLLStorageClass(), Out);
PrintThreadLocalModel(GIS->getThreadLocalMode(), Out);
@@ -2731,7 +2733,7 @@ void AssemblyWriter::printFunction(const Function *F) {
Out << "define ";
Out << getLinkagePrintName(F->getLinkage());
- PrintDSOLocation(F->isDSOLocal(), Out);
+ PrintDSOLocation(*F, Out);
PrintVisibility(F->getVisibility(), Out);
PrintDLLStorageClass(F->getDLLStorageClass(), Out);
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index b83201f982f..1a964dfb731 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -570,6 +570,11 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) {
Assert(!GV.isDSOLocal(),
"GlobalValue with DLLImport Storage is dso_local!", &GV);
+ if (GV.hasLocalLinkage())
+ Assert(GV.isDSOLocal(),
+ "GlobalValue with private or internal linkage must be dso_local!",
+ &GV);
+
forEachUser(&GV, GlobalValueVisited, [&](const Value *V) -> bool {
if (const Instruction *I = dyn_cast<Instruction>(V)) {
if (!I->getParent() || !I->getParent()->getParent())
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index c4c0dd22ee0..8e3a818690f 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -146,7 +146,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
GV->hasExternalWeakLinkage())
return false;
- if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility()))
+ if (GV && !GV->hasDefaultVisibility())
return true;
if (TT.isOSBinFormatMachO()) {
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 122f51a0d21..4a69fbfe435 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -265,6 +265,7 @@ static Function *createClone(Function &F, Twine Suffix, coro::Shape &Shape,
SmallVector<ReturnInst *, 4> Returns;
CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns);
+ NewF->setDSOLocal(true);
// Remove old returns.
for (ReturnInst *Return : Returns)
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 4bb2984e3b4..65dcd281009 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2486,6 +2486,7 @@ OptimizeGlobalAliases(Module &M,
// Give the aliasee the name, linkage and other attributes of the alias.
Target->takeName(&*J);
Target->setLinkage(J->getLinkage());
+ Target->setDSOLocal(J->isDSOLocal());
Target->setVisibility(J->getVisibility());
Target->setDLLStorageClass(J->getDLLStorageClass());
diff --git a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
index 08dae47bbf7..83039ad89b9 100644
--- a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
+++ b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
@@ -50,7 +50,7 @@
; a reference to it when reached while earlier analyzing the phi using its
; return value:
; op0=Y op4=func2
-; CHECK-DAG: <PERMODULE {{.*}} op0=8 op1=8 {{.*}} op4=0 op5=3/>
+; CHECK-DAG: <PERMODULE {{.*}} op0=8 op1=72 {{.*}} op4=0 op5=3/>
; Function Z contains call to func2, and ensures we don't incorrectly add
; a reference to it when reached while analyzing subsequent use of its return
; value:
diff --git a/llvm/test/Bitcode/thinlto-summary-linkage-types.ll b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll
index e8fea12e40b..e3e45181095 100644
--- a/llvm/test/Bitcode/thinlto-summary-linkage-types.ll
+++ b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll
@@ -5,8 +5,8 @@
; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED
define private void @private()
-; CHECK: <PERMODULE {{.*}} op1=8
-; COMBINED-DAG: <COMBINED {{.*}} op2=8
+; CHECK: <PERMODULE {{.*}} op1=72
+; COMBINED-DAG: <COMBINED {{.*}} op2=72
{
ret void
}
diff --git a/llvm/test/Bitcode/thinlto-summary-section.ll b/llvm/test/Bitcode/thinlto-summary-section.ll
index 3d67279617e..b115a99cd5e 100644
--- a/llvm/test/Bitcode/thinlto-summary-section.ll
+++ b/llvm/test/Bitcode/thinlto-summary-section.ll
@@ -4,10 +4,10 @@
; RUN: llvm-lto -thinlto -o %t2 %t.o
; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED
-; Flags should be 0x17 (23) for local linkage (0x3) and not being importable
+; Flags should be 0x57 (87) for local linkage (0x3), dso_local (0x40) and not being importable
; (0x10) due to local linkage plus having a section.
-; CHECK: <PERMODULE {{.*}} op1=23
-; COMBINED-DAG: <COMBINED {{.*}} op2=23
+; CHECK: <PERMODULE {{.*}} op1=87
+; COMBINED-DAG: <COMBINED {{.*}} op2=87
define internal void @functionWithSection() section "some_section" {
ret void
}
diff --git a/llvm/test/CodeGen/AMDGPU/enqueue-kernel.ll b/llvm/test/CodeGen/AMDGPU/enqueue-kernel.ll
index a54453541de..c04b9b1e8ca 100644
--- a/llvm/test/CodeGen/AMDGPU/enqueue-kernel.ll
+++ b/llvm/test/CodeGen/AMDGPU/enqueue-kernel.ll
@@ -65,7 +65,7 @@ entry:
ret void
}
-; CHECK: define amdgpu_kernel void @__test_block_invoke_kernel({{.*}}) #[[AT1:[0-9]+]]
+; CHECK: define dso_local amdgpu_kernel void @__test_block_invoke_kernel({{.*}}) #[[AT1:[0-9]+]]
define internal amdgpu_kernel void @__test_block_invoke_kernel(<{ i32, i32, i8 addrspace(4)*, i8 addrspace(1)*, i8 }> %arg) #0
!kernel_arg_addr_space !14 !kernel_arg_access_qual !15 !kernel_arg_type !16 !kernel_arg_base_type !16 !kernel_arg_type_qual !17 {
entry:
@@ -77,7 +77,7 @@ entry:
declare i32 @__enqueue_kernel_basic(%opencl.queue_t addrspace(1)*, i32, %struct.ndrange_t*, i8 addrspace(4)*) local_unnamed_addr
-; CHECK: define amdgpu_kernel void @__test_block_invoke_2_kernel({{.*}}) #[[AT2:[0-9]+]]
+; CHECK: define dso_local amdgpu_kernel void @__test_block_invoke_2_kernel({{.*}}) #[[AT2:[0-9]+]]
define internal amdgpu_kernel void @__test_block_invoke_2_kernel(<{ i32, i32, i8 addrspace(4)*, i8 addrspace(1)*,
i64 addrspace(1)*, i64, i8 }> %arg) #0 !kernel_arg_addr_space !14 !kernel_arg_access_qual !15
!kernel_arg_type !16 !kernel_arg_base_type !16 !kernel_arg_type_qual !17 {
diff --git a/llvm/test/LTO/Resolution/X86/comdat.ll b/llvm/test/LTO/Resolution/X86/comdat.ll
index 94f28384231..14401618498 100644
--- a/llvm/test/LTO/Resolution/X86/comdat.ll
+++ b/llvm/test/LTO/Resolution/X86/comdat.ll
@@ -77,7 +77,7 @@ bb11:
; CHECK-NEXT: ret i32 42
; CHECK-NEXT: }
-; CHECK: define internal dso_local i32 @f1.2(i8* %this) comdat($c2) {
+; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) {
; CHECK-NEXT: bb20:
; CHECK-NEXT: store i8* %this, i8** null
; CHECK-NEXT: br label %bb21
diff --git a/llvm/test/Linker/funcimport.ll b/llvm/test/Linker/funcimport.ll
index 9238fc1900e..e0b18f5ee96 100644
--- a/llvm/test/Linker/funcimport.ll
+++ b/llvm/test/Linker/funcimport.ll
@@ -13,12 +13,12 @@
; Ensure statics are promoted/renamed correctly from this file (all but
; constant variable need promotion).
; RUN: llvm-link %t.bc -summary-index=%t3.thinlto.bc -S | FileCheck %s --check-prefix=EXPORTSTATIC
-; EXPORTSTATIC-DAG: @staticvar.llvm.{{.*}} = hidden global
+; EXPORTSTATIC-DAG: @staticvar.llvm.{{.*}} = dso_local hidden global
; Eventually @staticconstvar can be exported as a copy and not promoted
-; EXPORTSTATIC-DAG: @staticconstvar.llvm.0 = hidden unnamed_addr constant
-; EXPORTSTATIC-DAG: @P.llvm.{{.*}} = hidden global void ()* null
-; EXPORTSTATIC-DAG: define hidden i32 @staticfunc.llvm.
-; EXPORTSTATIC-DAG: define hidden void @staticfunc2.llvm.
+; EXPORTSTATIC-DAG: @staticconstvar.llvm.0 = dso_local hidden unnamed_addr constant
+; EXPORTSTATIC-DAG: @P.llvm.{{.*}} = dso_local hidden global void ()* null
+; EXPORTSTATIC-DAG: define dso_local hidden i32 @staticfunc.llvm.
+; EXPORTSTATIC-DAG: define dso_local hidden void @staticfunc2.llvm.
; Ensure that both weak alias to an imported function and strong alias to a
; non-imported function are correctly turned into declarations.
@@ -67,13 +67,13 @@
; Ensure that imported static variable and function references are correctly
; promoted and renamed (including static constant variable).
; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=referencestatics:%t.bc -S | FileCheck %s --check-prefix=IMPORTSTATIC
-; IMPORTSTATIC-DAG: @staticvar.llvm.{{.*}} = external hidden global
+; IMPORTSTATIC-DAG: @staticvar.llvm.{{.*}} = external dso_local hidden global
; Eventually @staticconstvar can be imported as a copy
-; IMPORTSTATIC-DAG: @staticconstvar.llvm.{{.*}} = external hidden unnamed_addr constant
+; IMPORTSTATIC-DAG: @staticconstvar.llvm.{{.*}} = external dso_local hidden unnamed_addr constant
; IMPORTSTATIC-DAG: define available_externally i32 @referencestatics
; IMPORTSTATIC-DAG: %call = call i32 @staticfunc.llvm.
; IMPORTSTATIC-DAG: %0 = load i32, i32* @staticvar.llvm.
-; IMPORTSTATIC-DAG: declare hidden i32 @staticfunc.llvm.
+; IMPORTSTATIC-DAG: declare dso_local hidden i32 @staticfunc.llvm.
; Ensure that imported global (external) function and variable references
; are handled correctly (including referenced variable imported as
@@ -90,7 +90,7 @@
; Ensure that imported static function pointer correctly promoted and renamed.
; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=callfuncptr:%t.bc -S | FileCheck %s --check-prefix=IMPORTFUNCPTR
-; IMPORTFUNCPTR-DAG: @P.llvm.{{.*}} = external hidden global void ()*
+; IMPORTFUNCPTR-DAG: @P.llvm.{{.*}} = external dso_local hidden global void ()*
; IMPORTFUNCPTR-DAG: define available_externally void @callfuncptr
; IMPORTFUNCPTR-DAG: %0 = load void ()*, void ()** @P.llvm.
diff --git a/llvm/test/Other/extract.ll b/llvm/test/Other/extract.ll
index 08675d8bff3..076a4512e44 100644
--- a/llvm/test/Other/extract.ll
+++ b/llvm/test/Other/extract.ll
@@ -7,13 +7,13 @@
; llvm-extract uses lazy bitcode loading, so make sure it correctly reads
; from bitcode files in addition to assembly files.
-; CHECK: define hidden void @foo() comdat($x) {
+; CHECK: define dso_local hidden void @foo() comdat($x) {
; CHECK: ret void
; CHECK: }
; The private linkage for foo() should be changed to external linkage and
; hidden visibility added.
-; DELETE: declare hidden void @foo()
+; DELETE: declare dso_local hidden void @foo()
; DELETE-NOT: comdat
; DELETE: define void @bar() {
; DELETE: call void @foo()
diff --git a/llvm/test/ThinLTO/X86/alias_import.ll b/llvm/test/ThinLTO/X86/alias_import.ll
index ee4d533d0be..da4d52a456c 100644
--- a/llvm/test/ThinLTO/X86/alias_import.ll
+++ b/llvm/test/ThinLTO/X86/alias_import.ll
@@ -57,11 +57,11 @@
; IMPORT-DAG: declare void @globalfuncLinkonceAlias()
; IMPORT-DAG: define available_externally void @globalfuncWeakODRAlias()
; IMPORT-DAG: define available_externally void @globalfuncLinkonceODRAlias()
-; IMPORT-DAG: define available_externally void @internalfuncAlias()
+; IMPORT-DAG: define available_externally dso_local void @internalfuncAlias()
; IMPORT-DAG: declare void @internalfuncWeakAlias()
; IMPORT-DAG: declare void @internalfuncLinkonceAlias()
-; IMPORT-DAG: define available_externally void @internalfuncWeakODRAlias()
-; IMPORT-DAG: define available_externally void @internalfuncLinkonceODRAlias()
+; IMPORT-DAG: define available_externally dso_local void @internalfuncWeakODRAlias()
+; IMPORT-DAG: define available_externally dso_local void @internalfuncLinkonceODRAlias()
; IMPORT-DAG: define available_externally void @weakODRfuncAlias()
; IMPORT-DAG: declare void @weakODRfuncWeakAlias()
; IMPORT-DAG: declare void @weakODRfuncLinkonceAlias()
diff --git a/llvm/test/ThinLTO/X86/deadstrip.ll b/llvm/test/ThinLTO/X86/deadstrip.ll
index bd9e349234a..0764f5c073c 100644
--- a/llvm/test/ThinLTO/X86/deadstrip.ll
+++ b/llvm/test/ThinLTO/X86/deadstrip.ll
@@ -23,10 +23,10 @@
; RUN: llvm-nm %t.out.1 | FileCheck %s --check-prefix=CHECK2-NM
; RUN: llvm-bcanalyzer -dump %t.out.index.bc | FileCheck %s --check-prefix=COMBINED
-; Live, NotEligibleForImport, Internal
-; COMBINED-DAG: <COMBINED {{.*}} op2=55
-; Live, Internal
-; COMBINED-DAG: <COMBINED {{.*}} op2=39
+; Live, NotEligibleForImport, dso_local, Internal
+; COMBINED-DAG: <COMBINED {{.*}} op2=119
+; Live, dso_local, Internal
+; COMBINED-DAG: <COMBINED {{.*}} op2=103
; Live, Local, External
; COMBINED-DAG: <COMBINED {{.*}} op2=96
; COMBINED-DAG: <COMBINED {{.*}} op2=96
@@ -48,9 +48,9 @@
; LTO2-NOT: available_externally {{.*}} @baz()
; LTO2: @llvm.global_ctors =
; LTO2: define internal void @_GLOBAL__I_a()
-; LTO2: define internal dso_local void @bar() {
+; LTO2: define internal void @bar() {
; LTO2: define internal void @bar_internal()
-; LTO2: define internal dso_local void @dead_func() {
+; LTO2: define internal void @dead_func() {
; LTO2-NOT: available_externally {{.*}} @baz()
; Make sure we didn't internalize @boo, which is reachable via
diff --git a/llvm/test/ThinLTO/X86/export.ll b/llvm/test/ThinLTO/X86/export.ll
index cb87ddd063e..19aac1ce394 100644
--- a/llvm/test/ThinLTO/X86/export.ll
+++ b/llvm/test/ThinLTO/X86/export.ll
@@ -5,8 +5,8 @@
; Ensure statics are promoted/renamed correctly from this file.
; RUN: llvm-lto -thinlto-action=promote %t1.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s
-; CHECK-DAG: @staticvar.llvm.0 = hidden global
-; CHECK-DAG: define hidden void @staticfunc.llvm.0
+; CHECK-DAG: @staticvar.llvm.0 = dso_local hidden global
+; CHECK-DAG: define dso_local hidden void @staticfunc.llvm.0
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
diff --git a/llvm/test/ThinLTO/X86/funcimport.ll b/llvm/test/ThinLTO/X86/funcimport.ll
index 1e8784d7cac..1d853eeaa8c 100644
--- a/llvm/test/ThinLTO/X86/funcimport.ll
+++ b/llvm/test/ThinLTO/X86/funcimport.ll
@@ -9,12 +9,12 @@
; Ensure statics are promoted/renamed correctly from this file (all but
; constant variable need promotion).
; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=EXPORTSTATIC
-; EXPORTSTATIC-DAG: @staticvar.llvm.0 = hidden global
+; EXPORTSTATIC-DAG: @staticvar.llvm.0 = dso_local hidden global
; Eventually @staticconstvar can be exported as a copy and not promoted
-; EXPORTSTATIC-DAG: @staticconstvar.llvm.0 = hidden unnamed_addr constant
-; EXPORTSTATIC-DAG: @P.llvm.0 = hidden global void ()* null
-; EXPORTSTATIC-DAG: define hidden i32 @staticfunc.llvm.0
-; EXPORTSTATIC-DAG: define hidden void @staticfunc2.llvm.0
+; EXPORTSTATIC-DAG: @staticconstvar.llvm.0 = dso_local hidden unnamed_addr constant
+; EXPORTSTATIC-DAG: @P.llvm.0 = dso_local hidden global void ()* null
+; EXPORTSTATIC-DAG: define dso_local hidden i32 @staticfunc.llvm.0
+; EXPORTSTATIC-DAG: define dso_local hidden void @staticfunc2.llvm.0
; Ensure that weak alias to an imported function is correctly turned into
; a declaration.
diff --git a/llvm/test/ThinLTO/X86/internalize.ll b/llvm/test/ThinLTO/X86/internalize.ll
index 2392a4e21c7..9ff173e8cca 100644
--- a/llvm/test/ThinLTO/X86/internalize.ll
+++ b/llvm/test/ThinLTO/X86/internalize.ll
@@ -17,8 +17,8 @@
; INTERNALIZE: define internal void @bar
; INTERNALIZE: define internal void @linkonce_func()
; INTERNALIZE2: define dso_local void @foo
-; INTERNALIZE2: define internal dso_local void @bar
-; INTERNALIZE2: define internal dso_local void @linkonce_func()
+; INTERNALIZE2: define internal void @bar
+; INTERNALIZE2: define internal void @linkonce_func()
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
diff --git a/llvm/test/ThinLTO/X86/local_name_conflict.ll b/llvm/test/ThinLTO/X86/local_name_conflict.ll
index e4eb33e524d..cefc3ee0dda 100644
--- a/llvm/test/ThinLTO/X86/local_name_conflict.ll
+++ b/llvm/test/ThinLTO/X86/local_name_conflict.ll
@@ -13,7 +13,7 @@
; promoted name matches the imported copy.
; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t4.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=IMPORT
; IMPORT: call i32 @foo.llvm.[[HASH:[0-9]+]]
-; IMPORT: define available_externally hidden i32 @foo.llvm.[[HASH]]()
+; IMPORT: define available_externally dso_local hidden i32 @foo.llvm.[[HASH]]()
; The copy in %t2.bc should not be exported/promoted/renamed
; RUN: llvm-lto -thinlto-action=promote %t2.bc -thinlto-index=%t4.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=NOEXPORTSTATIC
@@ -21,7 +21,7 @@
; Make sure foo is promoted and renamed without complaint in %t3.bc.
; RUN: llvm-lto -thinlto-action=promote %t3.bc -thinlto-index=%t4.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=EXPORTSTATIC
-; EXPORTSTATIC: define hidden i32 @foo.llvm.
+; EXPORTSTATIC: define dso_local hidden i32 @foo.llvm.
; ModuleID = 'local_name_conflict_main.o'
source_filename = "local_name_conflict_main.c"
diff --git a/llvm/test/ThinLTO/X86/referenced_by_constant.ll b/llvm/test/ThinLTO/X86/referenced_by_constant.ll
index ac72edd5970..00cc7b9763f 100644
--- a/llvm/test/ThinLTO/X86/referenced_by_constant.ll
+++ b/llvm/test/ThinLTO/X86/referenced_by_constant.ll
@@ -9,15 +9,15 @@
; cause @referencedbyglobal and @localreferencedbyglobal to be exported
; and promoted).
; RUN: llvm-lto -thinlto-action=import %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=IMPORT
-; IMPORT: @someglobal.llvm.0 = external hidden unnamed_addr constant
-; IMPORT: @someglobal2.llvm.0 = external hidden unnamed_addr constant
+; IMPORT: @someglobal.llvm.0 = external dso_local hidden unnamed_addr constant
+; IMPORT: @someglobal2.llvm.0 = external dso_local hidden unnamed_addr constant
; IMPORT: define available_externally void @bar()
; Check the export side: we currently only export bar(), which causes
; @someglobal and @someglobal2 to be promoted (see above).
; RUN: llvm-lto -thinlto-action=promote %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=EXPORT
-; EXPORT: @someglobal.llvm.0 = hidden unnamed_addr constant
-; EXPORT: @someglobal2.llvm.0 = hidden unnamed_addr constant
+; EXPORT: @someglobal.llvm.0 = dso_local hidden unnamed_addr constant
+; EXPORT: @someglobal2.llvm.0 = dso_local hidden unnamed_addr constant
; EXPORT: define void @referencedbyglobal()
; EXPORT: define internal void @localreferencedbyglobal()
diff --git a/llvm/test/Transforms/FunctionImport/funcimport.ll b/llvm/test/Transforms/FunctionImport/funcimport.ll
index 4ff51a33b5e..472b20cfafd 100644
--- a/llvm/test/Transforms/FunctionImport/funcimport.ll
+++ b/llvm/test/Transforms/FunctionImport/funcimport.ll
@@ -55,7 +55,7 @@ declare i32 @referencestatics(...) #1
; Ensure that the call is to the properly-renamed function.
; INSTLIMDEF-DAG: Import staticfunc
; INSTLIMDEF-DAG: %call = call i32 @staticfunc.llvm.
-; INSTLIMDEF-DAG: define available_externally hidden i32 @staticfunc.llvm.{{.*}} !thinlto_src_module !0 {
+; INSTLIMDEF-DAG: define available_externally dso_local hidden i32 @staticfunc.llvm.{{.*}} !thinlto_src_module !0 {
; INSTLIMDEF-DAG: Import referenceglobals
; CHECK-DAG: define available_externally i32 @referenceglobals(i32 %i) !thinlto_src_module !0 {
@@ -80,7 +80,7 @@ declare void @callfuncptr(...) #1
; Ensure that all uses of local variable @P which has used in setfuncptr
; and callfuncptr are to the same promoted/renamed global.
-; CHECK-DAG: @P.llvm.{{.*}} = external hidden global void ()*
+; CHECK-DAG: @P.llvm.{{.*}} = external dso_local hidden global void ()*
; CHECK-DAG: %0 = load void ()*, void ()** @P.llvm.
; CHECK-DAG: store void ()* @staticfunc2.llvm.{{.*}}, void ()** @P.llvm.
@@ -99,8 +99,8 @@ declare void @weakfunc(...) #1
declare void @linkoncefunc2(...) #1
; INSTLIMDEF-DAG: Import funcwithpersonality
-; INSTLIMDEF-DAG: define available_externally hidden void @funcwithpersonality.llvm.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !thinlto_src_module !0 {
-; INSTLIM5-DAG: declare hidden void @funcwithpersonality.llvm.{{.*}}()
+; INSTLIMDEF-DAG: define available_externally dso_local hidden void @funcwithpersonality.llvm.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !thinlto_src_module !0 {
+; INSTLIM5-DAG: declare dso_local hidden void @funcwithpersonality.llvm.{{.*}}()
; CHECK-DAG: declare void @variadic(...)
declare void @variadic(...)
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll
index caea48e0a54..2db18a1bf04 100644
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll
@@ -25,9 +25,9 @@ $nt = comdat any
; MERGED-SAME: comdat(${{"?lwt[^ ]+}})
@lwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($lwt), !type !0
-; MERGED: {{@"?lwt_nl[^ ]+}} = hidden unnamed_addr global
+; MERGED: {{@"?lwt_nl[^ ]+}} = dso_local hidden unnamed_addr global
; MERGED-SAME: comdat(${{"?lwt[^ ]+}})
-; THIN: {{@"?lwt_nl[^ ]+}} = external hidden
+; THIN: {{@"?lwt_nl[^ ]+}} = external dso_local hidden
@lwt_nl = internal unnamed_addr global i32 0, comdat($lwt)
; MERGED: @nlwt_aliasee = private unnamed_addr global
@@ -47,11 +47,11 @@ $nt = comdat any
; THIN-SAME: comdat($nt)
@nt_nl = internal unnamed_addr global i32 0, comdat($nt)
-; MERGED: {{@"?lwt[^ ]+}} = hidden unnamed_addr alias
+; MERGED: {{@"?lwt[^ ]+}} = dso_local hidden unnamed_addr alias
; THIN: {{@"?lwt[^ ]+}} = external hidden
@lwt = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @lwt_aliasee
-; MERGED: {{@"?nlwt_nl[^ ]+}} = hidden unnamed_addr alias
+; MERGED: {{@"?nlwt_nl[^ ]+}} = dso_local hidden unnamed_addr alias
; THIN: {{@"?nlwt_nl[^ ]+}} = external hidden
@nlwt_nl = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @nlwt_aliasee
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
index 6d18c4f6f65..a36221c5f90 100644
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
@@ -12,8 +12,8 @@
; BCA0: <GLOBALVAL_SUMMARY_BLOCK
; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
-; M0: @"g$581d7631532fa146ba4061179da39272" = external hidden global i8{{$}}
-; M1: @"g$581d7631532fa146ba4061179da39272" = hidden global i8 42, !type !0
+; M0: @"g$581d7631532fa146ba4061179da39272" = external dso_local hidden global i8{{$}}
+; M1: @"g$581d7631532fa146ba4061179da39272" = dso_local hidden global i8 42, !type !0
@g = internal global i8 42, !type !0
; M0: define i8* @f()
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
index fbe618f08e3..5cfa14fddb8 100644
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
@@ -16,8 +16,8 @@
; M1: @g = global void ()* @"f$13757e0fb71915e385efa4dc9d1e08fd", !type !0
@g = global void ()* @f, !type !0
-; M0: define hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
-; M1: declare hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
+; M0: define dso_local hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
+; M1: declare dso_local hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
define internal void @f() {
call void @f2()
ret void
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
index 087796b5031..3bf7b5f53b3 100644
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
@@ -6,14 +6,14 @@ define [1 x i8*]* @source() {
ret [1 x i8*]* @g
}
-; M0: @"g$84f59439b469192440047efc8de357fb" = external hidden constant [1 x i8*]{{$}}
-; M1: @"g$84f59439b469192440047efc8de357fb" = hidden constant [1 x i8*] [i8* bitcast (i64 (i8*)* @"ok$84f59439b469192440047efc8de357fb" to i8*)]
+; M0: @"g$84f59439b469192440047efc8de357fb" = external dso_local hidden constant [1 x i8*]{{$}}
+; M1: @"g$84f59439b469192440047efc8de357fb" = dso_local hidden constant [1 x i8*] [i8* bitcast (i64 (i8*)* @"ok$84f59439b469192440047efc8de357fb" to i8*)]
@g = internal constant [1 x i8*] [
i8* bitcast (i64 (i8*)* @ok to i8*)
], !type !0
-; M0: define hidden i64 @"ok$84f59439b469192440047efc8de357fb"
-; M1: define available_externally hidden i64 @"ok$84f59439b469192440047efc8de357fb"
+; M0: define dso_local hidden i64 @"ok$84f59439b469192440047efc8de357fb"
+; M1: define available_externally dso_local hidden i64 @"ok$84f59439b469192440047efc8de357fb"
define internal i64 @ok(i8* %this) {
ret i64 42
}
diff --git a/llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll b/llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll
index 9b7cf8432f7..07509b3b22f 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll
@@ -81,12 +81,12 @@ define void @vf2(i8*) {
ret void
}
-; CHECK: define hidden void @"vf3$merged"(i8*) {
+; CHECK: define dso_local hidden void @"vf3$merged"(i8*) {
define internal void @vf3(i8*) {
ret void
}
-; CHECK: define hidden void @"vf4$merged"(i8*) comdat {
+; CHECK: define dso_local hidden void @"vf4$merged"(i8*) comdat {
define internal void @vf4(i8*) comdat {
ret void
}
diff --git a/llvm/test/tools/gold/X86/coff.ll b/llvm/test/tools/gold/X86/coff.ll
index e5a2da92a44..02d15de6fa0 100644
--- a/llvm/test/tools/gold/X86/coff.ll
+++ b/llvm/test/tools/gold/X86/coff.ll
@@ -11,7 +11,7 @@ define void @f() {
ret void
}
-; CHECK: define internal dso_local void @g() {
+; CHECK: define internal void @g() {
define hidden void @g() {
ret void
}
diff --git a/llvm/test/tools/gold/X86/emit-llvm.ll b/llvm/test/tools/gold/X86/emit-llvm.ll
index 120250ae37e..2baf3107e58 100644
--- a/llvm/test/tools/gold/X86/emit-llvm.ll
+++ b/llvm/test/tools/gold/X86/emit-llvm.ll
@@ -48,7 +48,7 @@ target triple = "x86_64-unknown-linux-gnu"
@g8 = external global i32
-; CHECK-DAG: define internal dso_local void @f1()
+; CHECK-DAG: define internal void @f1()
; OPT2-NOT: @f1
define hidden void @f1() {
ret void
diff --git a/llvm/test/tools/gold/X86/global_with_section.ll b/llvm/test/tools/gold/X86/global_with_section.ll
index 75e2a6978b2..d2b7097d812 100644
--- a/llvm/test/tools/gold/X86/global_with_section.ll
+++ b/llvm/test/tools/gold/X86/global_with_section.ll
@@ -45,7 +45,7 @@ target triple = "x86_64-unknown-linux-gnu"
; Confirm via a variable with a non-C identifier section that we are getting
; the expected internalization.
-; CHECK-DAG: @var_with_nonC_section = internal dso_local global i32 0, section ".nonCsection"
+; CHECK-DAG: @var_with_nonC_section = internal global i32 0, section ".nonCsection"
@var_with_nonC_section = global i32 0, section ".nonCsection"
; We should not internalize @deadfunc_with_section due to section
@@ -57,7 +57,7 @@ define void @deadfunc_with_section() section "some_other_section" {
; Confirm via a function with a non-C identifier section that we are getting
; the expected internalization.
-; CHECK-DAG: define internal dso_local void @deadfunc_with_nonC_section() section ".nonCsection"
+; CHECK-DAG: define internal void @deadfunc_with_nonC_section() section ".nonCsection"
define void @deadfunc_with_nonC_section() section ".nonCsection" {
call void @deadfunc2_called_from_nonC_section()
ret void
@@ -65,7 +65,7 @@ define void @deadfunc_with_nonC_section() section ".nonCsection" {
; In RegularLTO mode, where we have combined all the IR,
; @deadfunc2_called_from_section can be internalized.
-; CHECK2-REGULARLTO: define internal dso_local void @deadfunc2_called_from_section
+; CHECK2-REGULARLTO: define internal void @deadfunc2_called_from_section
; In ThinLTO mode, we can't internalize it as it needs to be preserved
; (due to the access from @deadfunc_with_section which must be preserved), and
; can't be internalized since the reference is from a different module.
@@ -74,6 +74,6 @@ declare void @deadfunc2_called_from_section()
; Confirm when called from a function with a non-C identifier section that we
; are getting the expected internalization.
-; CHECK2-REGULARLTO: define internal dso_local void @deadfunc2_called_from_nonC_section
-; CHECK2-THINLTO: define internal dso_local void @deadfunc2_called_from_nonC_section
+; CHECK2-REGULARLTO: define internal void @deadfunc2_called_from_nonC_section
+; CHECK2-THINLTO: define internal void @deadfunc2_called_from_nonC_section
declare void @deadfunc2_called_from_nonC_section()
diff --git a/llvm/test/tools/llvm-split/internal.ll b/llvm/test/tools/llvm-split/internal.ll
index ce4272c5f0d..0eb4acefb9b 100644
--- a/llvm/test/tools/llvm-split/internal.ll
+++ b/llvm/test/tools/llvm-split/internal.ll
@@ -2,8 +2,8 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0: define hidden void @foo()
-; CHECK1: declare hidden void @foo()
+; CHECK0: define dso_local hidden void @foo()
+; CHECK1: declare dso_local hidden void @foo()
define internal void @foo() {
call void @bar()
ret void
diff --git a/llvm/test/tools/llvm-split/preserve-locals.ll b/llvm/test/tools/llvm-split/preserve-locals.ll
index 7556c25bba3..070ff065193 100644
--- a/llvm/test/tools/llvm-split/preserve-locals.ll
+++ b/llvm/test/tools/llvm-split/preserve-locals.ll
@@ -9,7 +9,7 @@
; The main and local_func must not be together.
; CHECK1: @a
; CHECK1: define i32 @main
-; CHECK1: declare fastcc void @local_func
+; CHECK1: declare dso_local fastcc void @local_func
@a = internal global i32 0, align 4
@global_storage = common global i32 0, align 4
diff --git a/llvm/test/tools/llvm-split/scc-alias.ll b/llvm/test/tools/llvm-split/scc-alias.ll
index f8400bd2c87..49566acfc7e 100644
--- a/llvm/test/tools/llvm-split/scc-alias.ll
+++ b/llvm/test/tools/llvm-split/scc-alias.ll
@@ -4,9 +4,9 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare i32 @funInternal
+; CHECK0: declare dso_local i32 @funInternal
; CHECK0: declare i32 @funExternal
-; CHECK0: declare i32 @funInternal2
+; CHECK0: declare dso_local i32 @funInternal2
; CHECK0: declare i32 @funExternal2
; All functions are in the same file.
diff --git a/llvm/test/tools/llvm-split/scc-callchain.ll b/llvm/test/tools/llvm-split/scc-callchain.ll
index 953a0244ae7..1f3f157f08d 100644
--- a/llvm/test/tools/llvm-split/scc-callchain.ll
+++ b/llvm/test/tools/llvm-split/scc-callchain.ll
@@ -5,9 +5,9 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare i32 @funInternal0
-; CHECK0: declare i32 @funInternal1
-; CHECK0: declare i32 @funInternal2
+; CHECK0: declare dso_local i32 @funInternal0
+; CHECK0: declare dso_local i32 @funInternal1
+; CHECK0: declare dso_local i32 @funInternal2
; CHECK0: declare i32 @funExternal
; All functions are in the same file.
diff --git a/llvm/test/tools/llvm-split/scc-comdat.ll b/llvm/test/tools/llvm-split/scc-comdat.ll
index 40fa930110b..24bc961bf42 100644
--- a/llvm/test/tools/llvm-split/scc-comdat.ll
+++ b/llvm/test/tools/llvm-split/scc-comdat.ll
@@ -5,8 +5,8 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare i32 @fun1
-; CHECK0: declare i32 @fun2
+; CHECK0: declare dso_local i32 @fun1
+; CHECK0: declare dso_local i32 @fun2
; CHECK0: declare i32 @fun3
; CHECK1: define internal i32 @fun1
diff --git a/llvm/test/tools/llvm-split/scc-constants.ll b/llvm/test/tools/llvm-split/scc-constants.ll
index 066a8dac6da..f0fbea7ef9e 100644
--- a/llvm/test/tools/llvm-split/scc-constants.ll
+++ b/llvm/test/tools/llvm-split/scc-constants.ll
@@ -5,8 +5,8 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare i32 @foo
-; CHECK0: declare i32 @baz
+; CHECK0: declare dso_local i32 @foo
+; CHECK0: declare dso_local i32 @baz
; CHECK0: declare i32 @bar
; CHECK0: declare i32 @bar2
diff --git a/llvm/test/tools/llvm-split/scc-cycle.ll b/llvm/test/tools/llvm-split/scc-cycle.ll
index 031fa9b0316..704ac9a97ad 100644
--- a/llvm/test/tools/llvm-split/scc-cycle.ll
+++ b/llvm/test/tools/llvm-split/scc-cycle.ll
@@ -6,8 +6,8 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare i32 @funInternal0
-; CHECK0: declare i32 @funInternal1
+; CHECK0: declare dso_local i32 @funInternal0
+; CHECK0: declare dso_local i32 @funInternal1
; CHECK0: declare i32 @funExternal0
; CHECK0: declare i32 @funExternal1
diff --git a/llvm/test/tools/llvm-split/scc-global2global.ll b/llvm/test/tools/llvm-split/scc-global2global.ll
index 95ff5357d5b..c6a9688ad6d 100644
--- a/llvm/test/tools/llvm-split/scc-global2global.ll
+++ b/llvm/test/tools/llvm-split/scc-global2global.ll
@@ -5,8 +5,8 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
-; CHECK0: declare %struct.anon* @local0
-; CHECK0: declare i8** @local1
+; CHECK0: declare dso_local %struct.anon* @local0
+; CHECK0: declare dso_local i8** @local1
; CHECK1: @bla
; CHECK1: @ptr
diff --git a/llvm/test/tools/llvm-split/unnamed.ll b/llvm/test/tools/llvm-split/unnamed.ll
index fd24b4ca92b..b99696a3ce7 100644
--- a/llvm/test/tools/llvm-split/unnamed.ll
+++ b/llvm/test/tools/llvm-split/unnamed.ll
@@ -2,16 +2,16 @@
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
-; CHECK0: declare hidden void @__llvmsplit_unnamed()
-; CHECK1: define hidden void @__llvmsplit_unnamed()
+; CHECK0: declare dso_local hidden void @__llvmsplit_unnamed()
+; CHECK1: define dso_local hidden void @__llvmsplit_unnamed()
define internal void @0() {
; CHECK1: call void @foo()
call void @foo()
ret void
}
-; CHECK0: declare hidden void @__llvmsplit_unnamed.1()
-; CHECK1: define hidden void @__llvmsplit_unnamed.1()
+; CHECK0: declare dso_local hidden void @__llvmsplit_unnamed.1()
+; CHECK1: define dso_local hidden void @__llvmsplit_unnamed.1()
define internal void @1() {
; CHECK1: call void @foo()
; CHECK1: call void @foo()
OpenPOWER on IntegriCloud