[clang] [llvm-profdata] Do not create numerical strings for MD5 function names read from a Sample Profile. (PR #66164)

William Junda Huang via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 10:16:57 PDT 2023


================
@@ -85,7 +86,7 @@ class ProfiledCallGraph {
     std::queue<ContextTrieNode *> Queue;
     for (auto &Child : ContextTracker.getRootContext().getAllChildContext()) {
       ContextTrieNode *Callee = &Child.second;
-      addProfiledFunction(ContextTracker.getFuncNameFor(Callee));
+      addProfiledFunction(Callee->getFuncName());
----------------
huangjd wrote:

This is ok, see SampleProfile.cpp:1970. It will perform a MD5 to StringRef lookup if using MD5. 


```        Function *F = SymbolMap.lookup(
            FunctionSamples::UseMD5
                ? GUIDToFuncNameMap.lookup(Node->Name.getHashCode())
                : Node->Name.stringRef(Buffer));```

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


More information about the cfe-commits mailing list