summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@anl.gov>2019-10-07 23:21:52 +0000
committerJohannes Doerfert <jdoerfert@anl.gov>2019-10-07 23:21:52 +0000
commit766f2cc1a4bbe5008efc75d0439e8cee2813e76c (patch)
treeebf23f4069d6c49b0fdee59473b9b5ca66fbe5ab
parent661db04b98c9905ec38a218bd421327b7b888c13 (diff)
downloadbcm5719-llvm-766f2cc1a4bbe5008efc75d0439e8cee2813e76c.tar.gz
bcm5719-llvm-766f2cc1a4bbe5008efc75d0439e8cee2813e76c.zip
[Attributor] Use local linkage instead of internal
Local linkage is internal or private, and private is a specialization of internal, so either is fine for all our "local linkage" queries. llvm-svn: 373986
-rw-r--r--llvm/include/llvm/Transforms/IPO/Attributor.h4
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp8
-rw-r--r--llvm/test/Transforms/FunctionAttrs/internal-noalias.ll4
3 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 1811c233ebd..be41f82d7d0 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -810,8 +810,8 @@ struct Attributor {
/// This will trigger the identification and initialization of attributes for
/// \p F.
void markLiveInternalFunction(const Function &F) {
- assert(F.hasInternalLinkage() &&
- "Only internal linkage is assumed dead initially.");
+ assert(F.hasLocalLinkage() &&
+ "Only local linkage is assumed dead initially.");
identifyDefaultAbstractAttributes(const_cast<Function &>(F));
}
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 6c389f33f73..0bd454d8865 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -2081,7 +2081,7 @@ struct AAIsDeadImpl : public AAIsDead {
for (const Instruction &I : BB)
if (ImmutableCallSite ICS = ImmutableCallSite(&I))
if (const Function *F = ICS.getCalledFunction())
- if (F->hasInternalLinkage())
+ if (F->hasLocalLinkage())
A.markLiveInternalFunction(*F);
}
@@ -3933,7 +3933,7 @@ bool Attributor::checkForAllCallSites(
if (!AssociatedFunction)
return false;
- if (RequireAllCallSites && !AssociatedFunction->hasInternalLinkage()) {
+ if (RequireAllCallSites && !AssociatedFunction->hasLocalLinkage()) {
LLVM_DEBUG(
dbgs()
<< "[Attributor] Function " << AssociatedFunction->getName()
@@ -4319,7 +4319,7 @@ ChangeStatus Attributor::run(Module &M) {
// below fixpoint loop will identify and eliminate them.
SmallVector<Function *, 8> InternalFns;
for (Function &F : M)
- if (F.hasInternalLinkage())
+ if (F.hasLocalLinkage())
InternalFns.push_back(&F);
bool FoundDeadFn = true;
@@ -4634,7 +4634,7 @@ static bool runAttributorOnModule(Module &M, AnalysisGetter &AG) {
// We look at internal functions only on-demand but if any use is not a
// direct call, we have to do it eagerly.
- if (F.hasInternalLinkage()) {
+ if (F.hasLocalLinkage()) {
if (llvm::all_of(F.uses(), [](const Use &U) {
return ImmutableCallSite(U.getUser()) &&
ImmutableCallSite(U.getUser()).isCallee(&U);
diff --git a/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll b/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll
index cc207031015..9eec60b5e1e 100644
--- a/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll
+++ b/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll
@@ -8,9 +8,9 @@ entry:
ret i32 %add
}
-; CHECK: define internal i32 @noalias_args(i32* nocapture readonly %A, i32* noalias nocapture readonly %B)
+; CHECK: define private i32 @noalias_args(i32* nocapture readonly %A, i32* noalias nocapture readonly %B)
-define internal i32 @noalias_args(i32* %A, i32* %B) #0 {
+define private i32 @noalias_args(i32* %A, i32* %B) #0 {
entry:
%0 = load i32, i32* %A, align 4
%1 = load i32, i32* %B, align 4
OpenPOWER on IntegriCloud