<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 13, 2014 at 2:14 PM, Diego Novillo <span dir="ltr"><<a href="mailto:dnovillo@google.com" target="_blank">dnovillo@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Mar 13, 2014 at 11:51 AM, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br>

><br>
> On Mar 13, 2014, at 5:48 AM, Diego Novillo <<a href="mailto:dnovillo@google.com">dnovillo@google.com</a>> wrote:<br>
>><br>
</div><div class="">>> How are counters represented? Are these line numbers together with the<br>
>> counter? Basic blocks? Edges?<br>
><br>
> 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).<br>
<br>
</div>Sorry, you lost me.  How exactly does the FE map them to the code? In<br>
the sample profiler, each instrumented line consists of a line offset,<br>
a discriminator (to distinguish distinct control flow paths on the<br>
same line) and the counter. We match them by computing the absolute<br>
line number from the offset and assign the counter to the<br>
corresponding basic block.<br></blockquote><div><br></div><div>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).</div>
<div><br></div><div>David</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think we should be able to use the same pass in<br>
lib/Transforms/Scalar/SampleProfile.cpp to read profiles generated<br>
from instrumentation. The information is basically the same, so a bit<br>
of generalization of that code should be all we need to pass those<br>
counters down into the analysis module.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Diego.<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div></div>