This is an archive of the discontinued LLVM Phabricator instance.

Make ICP uses PSI to check for hotness.
ClosedPublic

Authored by danielcdh on Aug 4 2017, 3:46 PM.

Details

Summary

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.

Event Timeline

danielcdh created this revision.Aug 4 2017, 3:46 PM
danielcdh updated this revision to Diff 109832.Aug 4 2017, 3:50 PM

format the source

davidxl edited edge metadata.Aug 5 2017, 10:20 AM

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).

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.

Performance testing on loadtest does not show any difference with this patch with instrumentation based PGO.

davidxl accepted this revision.Aug 8 2017, 11:27 AM

lgtm

This revision is now accepted and ready to land.Aug 8 2017, 11:27 AM
danielcdh closed this revision.Aug 8 2017, 1:58 PM