[llvm-branch-commits] [llvm] [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
Mon Feb 12 20:36:41 PST 2024


================
@@ -560,35 +586,50 @@ Error InstrProfSymtab::initVTableNamesFromCompressedStrings(
       std::bind(&InstrProfSymtab::addVTableName, this, std::placeholders::_1));
 }
 
-Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName) {
-  if (Error E = addFuncName(PGOFuncName))
-    return E;
-  MD5FuncMap.emplace_back(Function::getGUID(PGOFuncName), &F);
+StringRef InstrProfSymtab::getCanonicalName(StringRef PGOName,
----------------
minglotus-6 wrote:

Unifying the two (and parameterizing the difference between instr and sample profiles like [`FunctionSamples::HasUniqSuffix`](https://github.com/llvm/llvm-project/blob/91dcf53abd34fa836a126c706f87b810d299d802/llvm/include/llvm/ProfileData/SampleProf.h#L1111) as function arguments) makes sense, and the [nfc patch](https://github.com/llvm/llvm-project/pull/81547) has a FIXME to do this.  A new file named `llvm/lib/ProfileData/ProfileCommon.cpp` seems a good place for the helper function. Currently `llvm/include/llvm/ProfileData/ProfileCommon.h` contains common classes used by sample and instr profiles.

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


More information about the llvm-branch-commits mailing list