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

Mingming Liu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 7 15:45:54 PST 2024


================
@@ -1628,6 +1664,17 @@ TEST(SymtabTest, instr_prof_symtab_module_test) {
     EXPECT_EQ(StringRef(PGOName), PGOFuncName);
     EXPECT_THAT(PGOFuncName.str(), EndsWith(Funcs[I].str()));
   }
+
+  StringRef VTables[] = {"ExternalGV", "PrivateGV"};
+  for (size_t I = 0; I < std::size(VTables); I++) {
+    GlobalVariable *GV =
+        M->getGlobalVariable(VTables[I], /* AllowInternal=*/true);
+
+    std::string IRPGOName = getIRPGOObjectName(*GV);
+    EXPECT_EQ(IRPGOName, ProfSymtab.getFuncOrVarName(
+                             IndexedInstrProf::ComputeHash(IRPGOName)));
+    EXPECT_EQ(VTables[I], getParsedIRPGOFuncName(IRPGOName).second);
----------------
minglotus-6 wrote:

An NFC patch (https://github.com/llvm/llvm-project/pull/81054) was created to generalize the function name.

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


More information about the llvm-branch-commits mailing list