[llvm] [ThinLTO] Use a set rather than a map to track exported ValueInfos. (PR #97360)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 09:44:32 PDT 2024


================
@@ -995,34 +995,36 @@ static bool isGlobalVarSummary(const ModuleSummaryIndex &Index,
   return false;
 }
 
+// Return the number of global summaries and record the number of function
+// summaries as output parameter.
 static unsigned numGlobalVarSummaries(const ModuleSummaryIndex &Index,
                                       FunctionImporter::ExportSetTy &ExportSet,
-                                      unsigned &DefinedGVS,
                                       unsigned &DefinedFS) {
-  DefinedGVS = 0;
+  unsigned NumGVS = 0;
   DefinedFS = 0;
   for (auto &VI : ExportSet) {
-    if (isGlobalVarSummary(Index, VI.getGUID())) {
-      ++DefinedGVS;
-    } else
+    if (isGlobalVarSummary(Index, VI.getGUID()))
+      ++NumGVS;
+    else
       ++DefinedFS;
----------------
minglotus-6 wrote:

Yes the number of function summaries could be deduced. I simplified the function.

https://github.com/llvm/llvm-project/pull/97360


More information about the llvm-commits mailing list