[LLVMdev] How to use BlockFrequency in inter-procedural context?

ibaev at codeaurora.org ibaev at codeaurora.org
Fri Dec 26 19:12:04 PST 2014


The BlockFrequency analysis has been useful for machine block placement,
register allocation and other function-level optimizations. How could we
extend it for use in an inter-procedural (whole-program) context? For
example, if we would like to compare the hotness of two call sites in
different functions, or calculate the hotness of two global variables
referenced in multiple functions.

If the ratio of a block BB frequency to the entry block frequency is the
expected number of times the block BB will execute per entry to the
function (according to LLVM Block Frequency Terminology page), would the
multiplication of that ratio to the profile count of the function be a
reasonable approximation of BB total execution count?

Thanks,
Ivan






More information about the llvm-dev mailing list