[llvm] [SampleFDO] Read call-graph matching recovered top-level function profile (PR #101053)

Lei Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 08:25:56 PDT 2024


================
@@ -413,6 +418,16 @@ class SampleProfileReader {
     if (It != Profiles.end())
       return &It->second;
 
+    if (FuncNameToProfNameMap && !FuncNameToProfNameMap->empty()) {
+      auto R = FuncNameToProfNameMap->find(FunctionId(Fname));
+      if (R != FuncNameToProfNameMap->end()) {
+        Fname = R->second.stringRef();
+        auto It = Profiles.find(FunctionId(Fname));
+        if (It != Profiles.end())
+          return &It->second;
+      }
+    }
----------------
wlei-llvm wrote:

There are a few(should be 3 places) `getSamplesFor` calls, then there would be duplicated codes.  Also see the line 431 `Remapper` is also used in this way(recalling we wanted to follow the usage of `remapper`)

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


More information about the llvm-commits mailing list