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

Bob Wilson bob.wilson at apple.com
Thu Mar 13 15:57:04 PDT 2014


On Mar 13, 2014, at 2:14 PM, Diego Novillo <dnovillo at google.com> wrote:

> On Thu, Mar 13, 2014 at 11:51 AM, Bob Wilson <bob.wilson at apple.com> wrote:
>> 
>> On Mar 13, 2014, at 5:48 AM, Diego Novillo <dnovillo at google.com> wrote:
>>> 
>>> How are counters represented? Are these line numbers together with the
>>> counter? Basic blocks? Edges?
>> 
>> There are no line numbers, basic blocks, or edges. It is just a sequence of counters that the front-end knows how to map to the code (the same as with our current textual file format).
> 
> Sorry, you lost me.  How exactly does the FE map them to the code? In
> the sample profiler, each instrumented line consists of a line offset,
> a discriminator (to distinguish distinct control flow paths on the
> same line) and the counter. We match them by computing the absolute
> line number from the offset and assign the counter to the
> corresponding basic block.

This is a proposal for the instrumentation-based approach that I talked about at the dev meeting. I don’t see how it can share the a file format with the sample profiler, since the content is fundamentally different.

> 
> I think we should be able to use the same pass in
> lib/Transforms/Scalar/SampleProfile.cpp to read profiles generated
> from instrumentation. The information is basically the same, so a bit
> of generalization of that code should be all we need to pass those
> counters down into the analysis module.

?? The information is completely different.



More information about the llvm-dev mailing list