[LLVMdev] [RFC] BlockFrequency is the wrong metric; we need a new one

Chandler Carruth chandlerc at google.com
Sun Feb 2 21:28:08 PST 2014


On Sun, Feb 2, 2014 at 9:07 PM, Andrew Trick <atrick at apple.com> wrote:

> That’s a good point. We could profile misprediction, but we have no way to
> express that either in the current BranchProbability/BlockFrequency API or
> in Chandler’s variant.
>

But I don't think we *need* to profile misprediction at all. It simply
isn't a problem that PGO needs to solve. The problems we're looking at for
PGO to help with are:

- i-cache locality / general code layout
- spill placement / live range splitting
- loop vectorization and unrolling[1]
- inlining[1]

For all of these, we're really looking at hot or cold region
identification, and clustering. I don't think that in these cases it is
perfectly reasonable to model "hot" and "cold" (in the branch probability
sense) as both heavily biased and high confidence in that bias, and
"not-hot" or "not-cold" as either not heavily biased *or* low confidence in
any indicated bias.

This gives us a simple linear model.


[1]: Note that even these are merely *speculative* use cases based on
experience with other systems. I'm not really trying to make sweeping
claims about *how* effective PGO will be here, only that it is an area that
various folks are looking at improving with PGO based on experience in
other system.s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140202/d8edbc8f/attachment.html>


More information about the llvm-dev mailing list