Skip to content

Commit f11899f

Browse files
[ThinLTO][WPD] Simplify check for local summary for efficiency (NFCI) (llvm#164859)
Use the new HasLocal flag to avoid looking through all summaries to see if there is a local copy.
1 parent b2c8b07 commit f11899f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,9 +1408,8 @@ bool DevirtIndex::trySingleImplDevirt(MutableArrayRef<ValueInfo> TargetsForSlot,
14081408

14091409
// If the summary list contains multiple summaries where at least one is
14101410
// a local, give up, as we won't know which (possibly promoted) name to use.
1411-
for (const auto &S : TheFn.getSummaryList())
1412-
if (GlobalValue::isLocalLinkage(S->linkage()) && Size > 1)
1413-
return false;
1411+
if (TheFn.hasLocal() && Size > 1)
1412+
return false;
14141413

14151414
// Collect functions devirtualized at least for one call site for stats.
14161415
if (PrintSummaryDevirt || AreStatisticsEnabled())

0 commit comments

Comments
 (0)