Lines Matching defs:VI
328 bool shouldImportGlobal(const ValueInfo &VI) {
329 const auto &GVS = DefinedGVSummaries.find(VI.getGUID());
342 if (VI.getSummaryList().size() > 1 &&
344 !IsPrevailing(VI.getGUID(), GVS->second))
353 for (const auto &VI : Summary.refs()) {
354 if (!shouldImportGlobal(VI)) {
360 LLVM_DEBUG(dbgs() << " ref -> " << VI << "\n");
374 for (const auto &RefSummary : VI.getSummaryList()) {
389 VI.getGUID(), GlobalValueSummary::Definition);
403 (*ExportLists)[RefSummary->modulePath()].insert(VI);
496 for (auto &VI : llvm::make_early_inc_range(ValueInfos)) {
497 auto It = DefinedGVSummaries.find(VI.getGUID());
499 IsPrevailing(VI.getGUID(), It->second)) {
501 dbgs() << "[Workload] " << VI.name()
507 qualifyCalleeCandidates(Index, VI.getSummaryList(), ModName);
514 LLVM_DEBUG(dbgs() << "[Workflow] Candidate for " << VI.name()
523 LLVM_DEBUG(dbgs() << "[Workload] Not importing " << VI.name()
525 << Function::getGUID(VI.name()) << "\n");
544 return IsPrevailing(VI.getGUID(), Candidate);
553 << VI.name()
572 LLVM_DEBUG(dbgs() << "[Workload] Not importing " << VI.name()
577 LLVM_DEBUG(dbgs() << "[Workload][Including]" << VI.name() << " from "
579 << Function::getGUID(VI.name()) << "\n");
580 ImportList[ExportingModule][VI.getGUID()] =
584 (*ExportLists)[ExportingModule].insert(VI);
601 ValueInfo VI = Index.getValueInfo(I);
602 if (!NameToValueInfo.insert(std::make_pair(VI.name(), VI)).second)
603 LLVM_DEBUG(AmbiguousNames.insert(VI.name()));
668 for (const auto &VI : Set) {
670 << " Would include: " << VI.getGUID() << "\n";
730 ValueInfo VI = Edge.first;
731 LLVM_DEBUG(dbgs() << " edge -> " << VI << " Threshold:" << Threshold
740 if (DefinedGVSummaries.count(VI.getGUID())) {
762 VI.getGUID(), std::make_tuple(NewThreshold, nullptr, nullptr)));
809 selectCallee(Index, VI.getSummaryList(), NewThreshold,
817 // Since definition takes precedence over declaration for the same VI,
818 // try emplace <VI, declaration> pair without checking insert result.
820 // VI. Note `ExportLists` only keeps track of exports due to imported
823 VI.getGUID(), GlobalValueSummary::Declaration);
842 VI, Edge.second.getHotness(), Reason, 1);
846 VI.name().str() + " due to " +
873 VI.getGUID(), GlobalValueSummary::Definition);
892 (*ExportLists)[ExportModulePath].insert(VI);
929 auto VI = Index.getValueInfo(GVSummary.first);
932 LLVM_DEBUG(dbgs() << "Ignores Dead GUID: " << VI << "\n");
940 LLVM_DEBUG(dbgs() << "Initialize import for " << VI << "\n");
970 if (!FailureInfo->VI.getSummaryList().empty())
972 FailureInfo->VI.getSummaryList()[0]->getBaseObject());
973 dbgs() << FailureInfo->VI
984 static bool isGlobalVarSummary(const ModuleSummaryIndex &Index, ValueInfo VI) {
985 auto SL = VI.getSummaryList();
993 if (const auto &VI = Index.getValueInfo(G))
994 return isGlobalVarSummary(Index, VI);
1003 for (auto &VI : ExportSet)
1004 if (isGlobalVarSummary(Index, VI.getGUID()))
1046 const ValueInfo &VI) {
1048 Index.findSummaryInModule(VI, ModulePath));
1056 for (auto &VI : ExportPerModule.second)
1057 if (!FlattenedImports.count(VI.getGUID()) &&
1058 IsReadOrWriteOnlyVarNeedingImporting(ExportPerModule.first, VI))
1089 // `NewExports` tracks the VI that gets exported because the full definition
1113 for (const auto &VI : GVS->refs())
1114 NewExports.insert(VI);
1261 auto VI = Index.getValueInfo(GUID);
1263 VI.getSummaryList(),
1278 EI.first = VI;
1307 ValueInfo VI = Index.getValueInfo(GUID);
1308 if (!VI)
1310 for (const auto &S : VI.getSummaryList())
1316 auto VI = Index.getValueInfo(Entry);
1321 LLVM_DEBUG(dbgs() << "Live root: " << VI << "\n");
1322 Worklist.push_back(VI);
1330 auto visit = [&](ValueInfo VI, bool IsAliasee) {
1340 if (llvm::any_of(VI.getSummaryList(),
1351 if (isPrevailing(VI.getGUID()) == PrevailingType::No) {
1354 for (const auto &S : VI.getSummaryList()) {
1374 for (const auto &S : VI.getSummaryList())
1377 Worklist.push_back(VI);
1381 auto VI = Worklist.pop_back_val();
1382 for (const auto &Summary : VI.getSummaryList()) {
1384 // If this is an alias, visit the aliasee VI to ensure that all copies