[PATCH] D158817: [CSSPGO] Refactoring SampleProfileMatcher::runOnFunction

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 17:46:09 PDT 2023


wlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2128
+      if (FunctionSamples::ProfileIsProbeBased && isa<PseudoProbeInst>(&I)) {
+        if (std::optional<PseudoProbe> Probe = extractProbe(I))
+          IRAnchors.emplace(LineLocation(Probe->Id, 0), StringRef());
----------------
hoy wrote:
> `extractProbe` can also be used to extract a probe from a callsite. Can this code be unified with the callsite handling code below to avoid the overwrite?
Try to understand this, do you mean we can just use the `LineLocation(Probe->Id, 0)` as the callsite location, it then can replace the `LineLocation IRCallsite = FunctionSamples::getCallSiteIdentifier(DLoc);`?

If so, that's a good idea for pseudo-probe. 

However, currently  callsite handling part of the code are still used for AutoFDO, we use the calliste related staleness metrics for AutoFDO. Then we probably still need the callsite handling code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158817



More information about the llvm-commits mailing list