[llvm] r322317 - Make internal/private GVs implicitly dso_local.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 11 14:15:05 PST 2018
Author: rafael
Date: Thu Jan 11 14:15:05 2018
New Revision: 322317
URL: http://llvm.org/viewvc/llvm-project?rev=322317&view=rev
Log:
Make internal/private GVs implicitly dso_local.
While updating clang tests for having clang set dso_local I noticed
that:
- There are *a lot* of tests to update.
- Many of the updates are redundant.
They are redundant because a GV is "obviously dso_local". This patch
starts formalizing that a bit by requiring that internal and private
GVs be dso_local too. Since they all are, we don't have to print
dso_local to the textual representation, making it a bit more compact
and easier to read.
Modified:
llvm/trunk/include/llvm/IR/GlobalValue.h
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/IR/AsmWriter.cpp
llvm/trunk/lib/IR/Verifier.cpp
llvm/trunk/lib/Target/TargetMachine.cpp
llvm/trunk/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll
llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll
llvm/trunk/test/Bitcode/thinlto-summary-section.ll
llvm/trunk/test/CodeGen/AMDGPU/enqueue-kernel.ll
llvm/trunk/test/LTO/Resolution/X86/comdat.ll
llvm/trunk/test/Linker/funcimport.ll
llvm/trunk/test/Other/extract.ll
llvm/trunk/test/ThinLTO/X86/alias_import.ll
llvm/trunk/test/ThinLTO/X86/deadstrip.ll
llvm/trunk/test/ThinLTO/X86/export.ll
llvm/trunk/test/ThinLTO/X86/funcimport.ll
llvm/trunk/test/ThinLTO/X86/internalize.ll
llvm/trunk/test/ThinLTO/X86/local_name_conflict.ll
llvm/trunk/test/ThinLTO/X86/referenced_by_constant.ll
llvm/trunk/test/Transforms/FunctionImport/funcimport.ll
llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/comdat.ll
llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
llvm/trunk/test/Transforms/WholeProgramDevirt/export-single-impl.ll
llvm/trunk/test/tools/gold/X86/coff.ll
llvm/trunk/test/tools/gold/X86/emit-llvm.ll
llvm/trunk/test/tools/gold/X86/global_with_section.ll
llvm/trunk/test/tools/llvm-split/internal.ll
llvm/trunk/test/tools/llvm-split/preserve-locals.ll
llvm/trunk/test/tools/llvm-split/scc-alias.ll
llvm/trunk/test/tools/llvm-split/scc-callchain.ll
llvm/trunk/test/tools/llvm-split/scc-comdat.ll
llvm/trunk/test/tools/llvm-split/scc-constants.ll
llvm/trunk/test/tools/llvm-split/scc-cycle.ll
llvm/trunk/test/tools/llvm-split/scc-global2global.ll
llvm/trunk/test/tools/llvm-split/unnamed.ll
Modified: llvm/trunk/include/llvm/IR/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/GlobalValue.h?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/IR/GlobalValue.h Thu Jan 11 14:15:05 2018
@@ -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); }
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Jan 11 14:15:05 2018
@@ -715,6 +715,13 @@ static bool isValidVisibilityForLinkage(
(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
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::st
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(Funct
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);
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Jan 11 14:15:05 2018
@@ -2497,8 +2497,10 @@ static void PrintVisibility(GlobalValue:
}
}
-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 G
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
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
Out << "define ";
Out << getLinkagePrintName(F->getLinkage());
- PrintDSOLocation(F->isDSOLocal(), Out);
+ PrintDSOLocation(*F, Out);
PrintVisibility(F->getVisibility(), Out);
PrintDLLStorageClass(F->getDLLStorageClass(), Out);
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Thu Jan 11 14:15:05 2018
@@ -570,6 +570,11 @@ void Verifier::visitGlobalValue(const Gl
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())
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Thu Jan 11 14:15:05 2018
@@ -146,7 +146,7 @@ bool TargetMachine::shouldAssumeDSOLocal
GV->hasExternalWeakLinkage())
return false;
- if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility()))
+ if (GV && !GV->hasDefaultVisibility())
return true;
if (TT.isOSBinFormatMachO()) {
Modified: llvm/trunk/lib/Transforms/Coroutines/CoroSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Coroutines/CoroSplit.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Coroutines/CoroSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Coroutines/CoroSplit.cpp Thu Jan 11 14:15:05 2018
@@ -265,6 +265,7 @@ static Function *createClone(Function &F
SmallVector<ReturnInst *, 4> Returns;
CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns);
+ NewF->setDSOLocal(true);
// Remove old returns.
for (ReturnInst *Return : Returns)
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Jan 11 14:15:05 2018
@@ -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());
Modified: llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll Thu Jan 11 14:15:05 2018
@@ -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:
Modified: llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll Thu Jan 11 14:15:05 2018
@@ -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
}
Modified: llvm/trunk/test/Bitcode/thinlto-summary-section.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-summary-section.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-summary-section.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-summary-section.ll Thu Jan 11 14:15:05 2018
@@ -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
}
Modified: llvm/trunk/test/CodeGen/AMDGPU/enqueue-kernel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/enqueue-kernel.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/enqueue-kernel.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/enqueue-kernel.ll Thu Jan 11 14:15:05 2018
@@ -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 {
Modified: llvm/trunk/test/LTO/Resolution/X86/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/comdat.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/comdat.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/comdat.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/Linker/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Linker/funcimport.ll (original)
+++ llvm/trunk/test/Linker/funcimport.ll Thu Jan 11 14:15:05 2018
@@ -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.
Modified: llvm/trunk/test/Other/extract.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/extract.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Other/extract.ll (original)
+++ llvm/trunk/test/Other/extract.ll Thu Jan 11 14:15:05 2018
@@ -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()
Modified: llvm/trunk/test/ThinLTO/X86/alias_import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/alias_import.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/alias_import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/alias_import.ll Thu Jan 11 14:15:05 2018
@@ -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()
Modified: llvm/trunk/test/ThinLTO/X86/deadstrip.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/deadstrip.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/deadstrip.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/deadstrip.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/ThinLTO/X86/export.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/export.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/export.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/export.ll Thu Jan 11 14:15:05 2018
@@ -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"
Modified: llvm/trunk/test/ThinLTO/X86/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/funcimport.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/funcimport.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/funcimport.ll Thu Jan 11 14:15:05 2018
@@ -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.
Modified: llvm/trunk/test/ThinLTO/X86/internalize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/internalize.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/internalize.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/internalize.ll Thu Jan 11 14:15:05 2018
@@ -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"
Modified: llvm/trunk/test/ThinLTO/X86/local_name_conflict.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/local_name_conflict.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/local_name_conflict.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/local_name_conflict.ll Thu Jan 11 14:15:05 2018
@@ -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"
Modified: llvm/trunk/test/ThinLTO/X86/referenced_by_constant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/referenced_by_constant.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/referenced_by_constant.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/referenced_by_constant.ll Thu Jan 11 14:15:05 2018
@@ -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()
Modified: llvm/trunk/test/Transforms/FunctionImport/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/funcimport.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/funcimport.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/funcimport.ll Thu Jan 11 14:15:05 2018
@@ -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(...)
Modified: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/comdat.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/comdat.ll (original)
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/comdat.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll (original)
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll Thu Jan 11 14:15:05 2018
@@ -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()
Modified: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll (original)
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll (original)
+++ llvm/trunk/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll Thu Jan 11 14:15:05 2018
@@ -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
}
Modified: llvm/trunk/test/Transforms/WholeProgramDevirt/export-single-impl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/WholeProgramDevirt/export-single-impl.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/WholeProgramDevirt/export-single-impl.ll (original)
+++ llvm/trunk/test/Transforms/WholeProgramDevirt/export-single-impl.ll Thu Jan 11 14:15:05 2018
@@ -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
}
Modified: llvm/trunk/test/tools/gold/X86/coff.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/coff.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/coff.ll (original)
+++ llvm/trunk/test/tools/gold/X86/coff.ll Thu Jan 11 14:15:05 2018
@@ -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
}
Modified: llvm/trunk/test/tools/gold/X86/emit-llvm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/emit-llvm.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/emit-llvm.ll (original)
+++ llvm/trunk/test/tools/gold/X86/emit-llvm.ll Thu Jan 11 14:15:05 2018
@@ -48,7 +48,7 @@ target triple = "x86_64-unknown-linux-gn
@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
Modified: llvm/trunk/test/tools/gold/X86/global_with_section.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/global_with_section.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/global_with_section.ll (original)
+++ llvm/trunk/test/tools/gold/X86/global_with_section.ll Thu Jan 11 14:15:05 2018
@@ -45,7 +45,7 @@ target triple = "x86_64-unknown-linux-gn
; 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() sec
; 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(
; 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_sect
; 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()
Modified: llvm/trunk/test/tools/llvm-split/internal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/internal.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/internal.ll (original)
+++ llvm/trunk/test/tools/llvm-split/internal.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/preserve-locals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/preserve-locals.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/preserve-locals.ll (original)
+++ llvm/trunk/test/tools/llvm-split/preserve-locals.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/scc-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-alias.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-alias.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-alias.ll Thu Jan 11 14:15:05 2018
@@ -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.
Modified: llvm/trunk/test/tools/llvm-split/scc-callchain.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-callchain.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-callchain.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-callchain.ll Thu Jan 11 14:15:05 2018
@@ -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.
Modified: llvm/trunk/test/tools/llvm-split/scc-comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-comdat.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-comdat.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-comdat.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/scc-constants.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-constants.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-constants.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-constants.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/scc-cycle.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-cycle.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-cycle.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-cycle.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/scc-global2global.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/scc-global2global.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/scc-global2global.ll (original)
+++ llvm/trunk/test/tools/llvm-split/scc-global2global.ll Thu Jan 11 14:15:05 2018
@@ -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
Modified: llvm/trunk/test/tools/llvm-split/unnamed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-split/unnamed.ll?rev=322317&r1=322316&r2=322317&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-split/unnamed.ll (original)
+++ llvm/trunk/test/tools/llvm-split/unnamed.ll Thu Jan 11 14:15:05 2018
@@ -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()
More information about the llvm-commits
mailing list