[llvm-commits] [llvm] r147286 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/preserve-branchweights.ll

Andrew Trick atrick at apple.com
Tue Jan 10 10:20:51 PST 2012


On Dec 27, 2011, at 11:05 PM, Nick Lewycky wrote:

> If you were thinking of BlockFrequency, I'd appreciate some 
> documentation for it. I don't know what it computes (what is a "block 
> frequency"?)


For the record...

BlockFrequency is the number of times a block is expected to execute relative to the number of times its parent function is called. It's an optional analysis that can be more convenient to work with than BranchProbabilities. e.g. we don't need to recompute the loop trip count.

BranchProbabilities are the ultimate source of profiling truth, from which block frequencies can be estimated (accurate computation being too expensive with irreducible CFGs).

Some profilers are not branch aware, and will actually gather block counts. Those need to be converted to branch probabilities for use in the IR, but that step is not something we're concerned with at the IR level. You can then think of block frequency as a filtered and normalized form of those block counts.

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120110/c501bbeb/attachment.html>


More information about the llvm-commits mailing list