[llvm] [NFC][InstrProf]Factor out getCanonicalName to compute the canonical name given a pgo name. (PR #81547)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 19:04:35 PST 2024


================
@@ -449,6 +449,19 @@ class InstrProfSymtab {
     return "** External Symbol **";
   }
 
+  // Returns the canonial name of the given PGOName. In a canonical name, all
+  // suffixes that begins with "." except ".__uniq." are stripped.
+  // FIXME: Unify this with `FunctionSamples::getCanonicalFnName`. And both
+  // should probably preserve `.specialized.<NSpecs>` suffix now that
----------------
minglotus-6 wrote:

ah you are correct. I initially thought stripping `.specialized.<NSpecs>` from function names gives in-accurate profile matching (maps names corresponding to different functions to one `&F`), but the specialized copies doesn't exist at profile annotation. I'm not aware of other places where the profiles for specialized copies (if the specialized copies exist in the instrumented or sampled binary) are handled, but I'll remove the comment.

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


More information about the llvm-commits mailing list