(original) (raw)
On Thu, Mar 13, 2014 at 2:14 PM, Diego Novillo <dnovillo@google.com> wrote:
On Thu, Mar 13, 2014 at 11:51 AM, Bob Wilson <bob.wilson@apple.com> wrote:
>
> On Mar 13, 2014, at 5:48 AM, Diego Novillo <dnovillo@google.com> wrote:
>>
>> How are counters represented? Are these line numbers together with theSorry, you lost me. �How exactly does the FE map them to the code? In
\>> 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).
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.
For GCC, it is CFG based matching -- it requires exact match of sources between instrumentation and annotation (the counters are laid out in some CFG order).
David
�
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.
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu � � � � http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev