[PATCH] D120784: [CSSPGO][PriorityInliner] Do not use block weight to drive callsite inlining.

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 16:41:12 PST 2022


wenlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:1309
+  uint64_t CallsiteCount =
+      CalleeSamples ? CalleeSamples->getEntrySamples() * Factor : 0;
   *NewCandidate = {CB, CalleeSamples, CallsiteCount, Factor};
----------------
hoy wrote:
> wenlei wrote:
> > When we don't have callee samples, should we fall back to call site block counts? 
> > 
> > In reality we would also need to tolerate some source change, i.e. the call site didn't exist in pass1 build. 
> If the callsite doesn't exist in pass1, the caller profile will probably be discarded due to checksum mismatch. So here when callee sample is missing, it's likely that the callsite is cold in this particular context. Using block count might end up treating it as hot.
> If the callsite doesn't exist in pass1, the caller profile will probably be discarded due to checksum mismatch. 

Is it? If that's the behavior today, it defeats the purpose of CFG based profile - we should be able to match as long as CFG does not change. we can have a change that adds a call site without changing CFG. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120784



More information about the llvm-commits mailing list