llvm.org GIT mirror llvm / 7a41fbe
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373986 91177308-0d34-0410-b5e6-96231b3b80d8 Johannes Doerfert 1 year, 1 month ago
3 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
809809 /// This will trigger the identification and initialization of attributes for
810810 /// \p F.
811811 void markLiveInternalFunction(const Function &F) {
812 assert(F.hasInternalLinkage() &&
813 "Only internal linkage is assumed dead initially.");
812 assert(F.hasLocalLinkage() &&
813 "Only local linkage is assumed dead initially.");
814814
815815 identifyDefaultAbstractAttributes(const_cast(F));
816816 }
20802080 for (const Instruction &I : BB)
20812081 if (ImmutableCallSite ICS = ImmutableCallSite(&I))
20822082 if (const Function *F = ICS.getCalledFunction())
2083 if (F->hasInternalLinkage())
2083 if (F->hasLocalLinkage())
20842084 A.markLiveInternalFunction(*F);
20852085 }
20862086
39323932 if (!AssociatedFunction)
39333933 return false;
39343934
3935 if (RequireAllCallSites && !AssociatedFunction->hasInternalLinkage()) {
3935 if (RequireAllCallSites && !AssociatedFunction->hasLocalLinkage()) {
39363936 LLVM_DEBUG(
39373937 dbgs()
39383938 << "[Attributor] Function " << AssociatedFunction->getName()
43184318 // below fixpoint loop will identify and eliminate them.
43194319 SmallVector InternalFns;
43204320 for (Function &F : M)
4321 if (F.hasInternalLinkage())
4321 if (F.hasLocalLinkage())
43224322 InternalFns.push_back(&F);
43234323
43244324 bool FoundDeadFn = true;
46334633
46344634 // We look at internal functions only on-demand but if any use is not a
46354635 // direct call, we have to do it eagerly.
4636 if (F.hasInternalLinkage()) {
4636 if (F.hasLocalLinkage()) {
46374637 if (llvm::all_of(F.uses(), [](const Use &U) {
46384638 return ImmutableCallSite(U.getUser()) &&
46394639 ImmutableCallSite(U.getUser()).isCallee(&U);
77 ret i32 %add
88 }
99
10 ; CHECK: define internal i32 @noalias_args(i32* nocapture readonly %A, i32* noalias nocapture readonly %B)
10 ; CHECK: define private i32 @noalias_args(i32* nocapture readonly %A, i32* noalias nocapture readonly %B)
1111
12 define internal i32 @noalias_args(i32* %A, i32* %B) #0 {
12 define private i32 @noalias_args(i32* %A, i32* %B) #0 {
1313 entry:
1414 %0 = load i32, i32* %A, align 4
1515 %1 = load i32, i32* %B, align 4