[llvm-branch-commits] [llvm] [InstrProf] Add vtables with type metadata into symtab to look it up with GUID (PR #81051)

Teresa Johnson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 13 12:01:31 PST 2024


================
@@ -479,15 +479,37 @@ Error InstrProfSymtab::create(Module &M, bool InLTO) {
       continue;
     Types.clear();
     G.getMetadata(LLVMContext::MD_type, Types);
-    if (!Types.empty()) {
-      MD5VTableMap.emplace_back(G.getGUID(), &G);
-    }
+    if (Types.empty())
+      continue;
+    if (Error E = addVTableWithName(
+              G, getIRPGOObjectName(G, InLTO, /* PGONameMetadata */ nullptr)))
+        return E;
   }
   Sorted = false;
   finalizeSymtab();
   return Error::success();
 }
 
+Error InstrProfSymtab::addVTableWithName(GlobalVariable &VTable,
+                                         StringRef VTablePGOName) {
+                                          
+  auto mapName = [&](StringRef Name) -> Error {
+    if (Error E = addVTableName(Name))
----------------
teresajohnson wrote:

Where is addVTableName defined?

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


More information about the llvm-branch-commits mailing list