[PATCH] D45377: [SampleFDO] Don't let inliner treat warm callsite with inline instance in the profile as cold

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 15 18:33:31 PDT 2018


danielcdh added a comment.

Thanks for the fix!

I think maybe a preferred way to fix this is to change SampleProfileLoader::inlineHotFunctions to inline these "warm" inlined callsites early. The current algorithm uses callsiteIsHot, which compares inline instance's total count to the caller's total count, which could be misleading if the caller is super large/hot. A better algorithm should compare inline instance's total count to PSI to get a global hotness. In this way, if the profile annotator thinks a callsite is not hot, the later inliner should *not* even try to inline it. This makes the design cleaner and more stable. WDYT?


Repository:
  rL LLVM

https://reviews.llvm.org/D45377





More information about the llvm-commits mailing list