[clang] [llvm] Compute GUIDs once and store in metadata (PR #184065)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 12:17:02 PDT 2026


================
@@ -625,12 +625,18 @@ static void dropDeadSymbols(Module &Mod, const GVSummaryMapTy &DefinedGlobals,
                             const ModuleSummaryIndex &Index) {
   llvm::TimeTraceScope timeScope("Drop dead symbols");
   std::vector<GlobalValue*> DeadGVs;
-  for (auto &GV : Mod.global_values())
-    if (GlobalValueSummary *GVS = DefinedGlobals.lookup(GV.getGUID()))
+
+  for (auto &GV : Mod.global_values()) {
+    auto GUID = Mod.getGUID(&GV);
----------------
teresajohnson wrote:

Why do we need to consult the table on the Module here instead of invoking getGUID on the GV? 

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


More information about the llvm-commits mailing list