This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Function section hotness prefix should look at all blocks
ClosedPublic

Authored by tejohnson on Dec 19 2017, 7:24 AM.

Details

Summary

The function section prefix for PGO based layout (e.g. hot/unlikely)
should look at the hotness of all blocks not just the entry BB.
A function with a cold entry but a very hot loop should be placed in the
hot section, for example, so that it is located close to other hot
functions it may call. For SamplePGO it was already looking at the
branch weights on calls, and I made that code conditional on whether
this is SamplePGO since it was essentially a noop for instrumentation
PGO anyway.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson created this revision.Dec 19 2017, 7:24 AM
davidxl accepted this revision.Dec 20 2017, 9:51 AM

lgtm

This revision is now accepted and ready to land.Dec 20 2017, 9:51 AM
This revision was automatically updated to reflect the committed changes.