[PATCH] D147297: [AutoFDO]Merge called target in body samples
    Lei Wang via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar 31 12:38:51 PDT 2023
    
    
  
wlei accepted this revision.
wlei added a comment.
This revision is now accepted and ready to land.
LGTM, thanks for the fix!
================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:1354
     } else {
-      for (const auto &Line : FS.getBodySamples()) {
-        Profile.addBodySamples(Line.first.LineOffset, Line.first.Discriminator,
-                               Line.second.getSamples());
+      for (const auto &[DI, SampleRecord] : FS.getBodySamples()) {
+        Profile.addBodySamples(DI.LineOffset, DI.Discriminator,
----------------
mingmingl wrote:
> davidxl wrote:
> > wlei wrote:
> > > Nit: Looks like there is an existing function https://github.com/llvm/llvm-project/blob/main/llvm/lib/ProfileData/SampleProf.cpp#L119 doing the similar thing, but I guess that requires some changes of it, I'm good for this version, note here just in case people like to refactor it in the future:) 
> > Perhaps add a TODO comment.
> Thanks  for the pointer. Did a little refactor in the new code path (may slightly prefer a separate refactor if the effort is larger or may affect more users)
Good idea to leverage the `addSampleRecord`, thanks!
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147297/new/
https://reviews.llvm.org/D147297
    
    
More information about the llvm-commits
mailing list