[LLVMdev] RFC: Binary format for instrumentation based profiling data

Bob Wilson bob.wilson at apple.com
Fri Mar 14 16:13:15 PDT 2014


On Mar 14, 2014, at 5:40 AM, Diego Novillo <dnovillo at google.com> wrote:

> 
> 
> 
> On Thu, Mar 13, 2014 at 9:19 PM, Justin Bogner <mail at justinbogner.com> wrote:
> 
> The instrumentation based profiling is done in the front end, and the counters are related to parts do the AST. Their isn't enough information for a backend pass to map them to *anything*. We feed block frequency and branch probability through metadata, much like the sampling based approach, but it happens during irgen in the front end, rather than in a backend pass.
> 
> Ah, OK. At least we get the annotations through to the backend. So, instrumentation gathers both block and edge weights? Or do you derive edge weights from blocks?

The IR only has branch weight metadata, and we add that directly to the branch instructions. In most cases, we can just use the block counts to calculate the branch weights, but in a few cases, we insert counters on the edges when that is necessary to get the correct weights.

>  
> 
> While it might be possible to translate the instrumentation format to the profile format, it wouldn't be possible to go the other way, and the translation would be imperfect. 
> 
> I'm only interested in passing the instrumentation down to the back end. Are you folks thinking of doing other kinds of instrumentation? (value profiling, for example).

We’ve discussed that possibility but not in any detail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140314/19fe9562/attachment.html>


More information about the llvm-dev mailing list