[PATCH] D35148: Use DenseMap instead std::map for GVSummaryMapTy.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 11:36:57 PDT 2017


danielcdh added a comment.

How should we proceed with this patch?

There are indeed some code that iterates through this type, e.g.:

  // Populate the worklist with the import for the functions in the current
  // module
  for (auto &GVSummary : DefinedGVSummaries) {
    if (!Index.isGlobalValueLive(GVSummary.second)) {
      DEBUG(dbgs() << "Ignores Dead GUID: " << GVSummary.first << "\n");
      continue;
    }
    auto *Summary = GVSummary.second;
    if (auto *AS = dyn_cast<AliasSummary>(Summary))
      Summary = &AS->getAliasee();
    auto *FuncSummary = dyn_cast<FunctionSummary>(Summary);
    if (!FuncSummary)
      // Skip import for global variables
      continue;
    DEBUG(dbgs() << "Initalize import for " << GVSummary.first << "\n");
    computeImportForFunction(*FuncSummary, Index, ImportInstrLimit,
                             DefinedGVSummaries, Worklist, ImportList,
                             ExportLists);
  }


https://reviews.llvm.org/D35148





More information about the llvm-commits mailing list