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

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


================
@@ -1163,50 +1165,58 @@ LTO::addThinLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
   llvm::TimeTraceScope timeScope("LTO add thin LTO");
   const auto BMID = BM.getModuleIdentifier();
   ArrayRef<SymbolResolution> ResTmp = Res;
+  DenseSet<StringRef> Prevailing;
   for (const InputFile::Symbol &Sym : Syms) {
     assert(!ResTmp.empty());
     const SymbolResolution &R = ResTmp.consume_front();
-
-    if (!Sym.getIRName().empty() && R.Prevailing) {
-      auto GUID = GlobalValue::getGUIDAssumingExternalLinkage(
-          GlobalValue::getGlobalIdentifier(Sym.getIRName(),
-                                           GlobalValue::ExternalLinkage, ""));
-      ThinLTO.setPrevailingModuleForGUID(GUID, BMID);
-    }
+    if (!Sym.getIRName().empty() && R.Prevailing)
+      Prevailing.insert(Sym.getIRName());
   }
 
+  StringMap<GlobalValue::GUID> IRSpecifiedGUIDs;
----------------
teresajohnson wrote:

Can you expand the comment to note what we are mapping from? I.e. what are the string keys

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


More information about the cfe-commits mailing list