Currently, ICP checks the count against a fixed value to see if it is hot enough to be promoted. This does not work for SamplePGO because sampled count may be much smaller. This patch uses PSI to check if the count is hot enough to be promoted.
This change may affect instrumentation PGO. I suspect it will greatly increase count threshold which may negatively affect performance. For instance some not so hot targets have small function body which is always good candidate to inline (after ICP).
Agree. But why would we care about those not-so-hot targets? OTOH, there is also possibility that a not-so-hot target get promoted and inlined to increase the hot-caller's size to further prevent it from being inlined into its caller.
I'll do a round of testing on this change to see the impact on instrumentation PGO.