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

Diego Novillo dnovillo at google.com
Thu Mar 13 14:14:11 PDT 2014


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.

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.


Diego.



More information about the llvm-dev mailing list