diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index 1811c233ebd9..be41f82d7d0f 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(F)); } diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 6c389f33f732..0bd454d88658 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 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 cc207031015f..9eec60b5e1e6 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