[PATCH] D154637: [SamplePGO] Fix ICE that callee samples returns null while finding import functions

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 09:28:30 PDT 2023


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:1079
+    // for:
+    // 1. Repalyed function.
+    // 2. Callee target is changed during inlining. For example: During
----------------
hoy wrote:
> typo: Replayed
How about framing the comment like this:


An inline candidate that is originally an indirect call can be optimized to a direct call due to the inlining of other candidates (e.,g constant propagation of the function pointer). This may cause the an lookup error of the candidate samples if the promoted call target doesn't exist in the profile due to profile staleness. Since it's known that the callsite is a good candidate and it should still be good to inline it regardless. This also matches the behavior of in-module inlining.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154637



More information about the llvm-commits mailing list