[PATCH] D147297: [AutoFDO]Merge called target in body samples

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 21:56:00 PDT 2023


mingmingl created this revision.
Herald added a subscriber: wenlei.
Herald added a project: All.
mingmingl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147297

Files:
  llvm/include/llvm/ProfileData/SampleProf.h


Index: llvm/include/llvm/ProfileData/SampleProf.h
===================================================================
--- llvm/include/llvm/ProfileData/SampleProf.h
+++ llvm/include/llvm/ProfileData/SampleProf.h
@@ -1352,8 +1352,12 @@
       Profile.setTotalSamples(0);
     } else {
       for (const auto &Line : FS.getBodySamples()) {
+        const auto& Samples = Line.second;
         Profile.addBodySamples(Line.first.LineOffset, Line.first.Discriminator,
-                               Line.second.getSamples());
+                               Samples.getSamples());
+        for (const auto& [CalledTarget, Count] : Samples.getCallTargets()) {
+          Profile.addCalledTargetSamples(Line.first.LineOffset, Line.first.Discriminator, CalledTarget, Count);
+        }
       }
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147297.509898.patch
Type: text/x-patch
Size: 797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230331/eba2181d/attachment.bin>


More information about the llvm-commits mailing list