[PATCH] D156725: [CSSPGO] Skip reporting staleness metrics for imported functions

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 23:39:56 PDT 2023


hoy accepted this revision.
hoy added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2425
     if (const auto *FS = Reader.getSamplesFor(F))
       countProfileMismatches(F, *FS, IRAnchors, ProfileAnchors);
   }
----------------
hoy wrote:
> As discussed in the other patch `https://reviews.llvm.org/D158891`, skipping external functions may cause its nested non-external callee samples to be skipped too. This is not what we want?
As using nested profile to count mismatches is by-design, the problem here is not quite relevant to the other patch and the external function check here.

A better way to frame the question is, when and where will the nested callee samples be counted if they are not inlined but its checksum is mismatched? In this case, the callee samples can be returned during inlining, but it should be counted when processing the callee.

The problem seems not easy to solve as the matcher doesn't know if a callsite will be inlined or not, and due to a hack in our system inlined samples always skip the checksum check. 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156725/new/

https://reviews.llvm.org/D156725



More information about the llvm-commits mailing list