/// 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));
}
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);
}
if (!AssociatedFunction)
return false;
- if (RequireAllCallSites && !AssociatedFunction->hasInternalLinkage()) {
+ if (RequireAllCallSites && !AssociatedFunction->hasLocalLinkage()) {
LLVM_DEBUG(
dbgs()
<< "[Attributor] Function " << AssociatedFunction->getName()
// 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;
// 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);
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