Skip to content

Commit a909ec6

Browse files
[ThinLTO][WPD] LICM a loop invariant check (#164862)
Move a loop invariant check out of the innermost loop. I measured a small but consistent thin link speedup from this change for a large target (0.75%).
1 parent f11899f commit a909ec6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,17 +948,17 @@ void llvm::updateVCallVisibilityInIndex(
948948
// linker, as we have no information on their eventual use.
949949
if (DynamicExportSymbols.count(P.first))
950950
continue;
951+
// With validation enabled, we want to exclude symbols visible to regular
952+
// objects. Local symbols will be in this group due to the current
953+
// implementation but those with VCallVisibilityTranslationUnit will have
954+
// already been marked in clang so are unaffected.
955+
if (VisibleToRegularObjSymbols.count(P.first))
956+
continue;
951957
for (auto &S : P.second.getSummaryList()) {
952958
auto *GVar = dyn_cast<GlobalVarSummary>(S.get());
953959
if (!GVar ||
954960
GVar->getVCallVisibility() != GlobalObject::VCallVisibilityPublic)
955961
continue;
956-
// With validation enabled, we want to exclude symbols visible to regular
957-
// objects. Local symbols will be in this group due to the current
958-
// implementation but those with VCallVisibilityTranslationUnit will have
959-
// already been marked in clang so are unaffected.
960-
if (VisibleToRegularObjSymbols.count(P.first))
961-
continue;
962962
GVar->setVCallVisibility(GlobalObject::VCallVisibilityLinkageUnit);
963963
}
964964
}

0 commit comments

Comments
 (0)