<div dir="ltr">Dear Duncan,<div><br></div><div>Thank you a lot for your feedback. I have a problem though. The branch weights counters overflow in some files and thus I get incorrect numbers. </div><div>Is there any way to find a workaround for that? Is is supposed to be a known bug or is it something that needs configuration on my part?</div><div><br></div><div>Again, thank you a lot for your reply.</div><div><br></div><div>Best Regards,</div><div>Georgios Zacharopoulos</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-03 18:23 GMT+01:00 Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(Ideally you would have sent this to <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> (and<br>
CC'ed me) so that the answer is there for others to find in the<br>
archive. If you have any follow-up questions, please add llvm-dev<br>
to the CC list.)<br>
<br>
Assuming you already have branch weights, you should use the<br>
BlockFrequencyInfo analysis to calculate the block frequencies. At<br>
the Machine level, there's a MachineBlockFrequencyInfo analysis.<br>
<br>
The frequencies shouldn't be used in isolation, but with reference<br>
to each other.<br>
<br>
Cheers,<br>
Duncan<br>
<div class="HOEnZb"><div class="h5"><br>
> On 2016-Feb-03, at 00:43, Giorgio Zacharo <<a href="mailto:giorgiozacharo@gmail.com">giorgiozacharo@gmail.com</a>> wrote:<br>
><br>
> Dear Duncan,<br>
><br>
> My name is Georgios Zacharopoulos and I am a PhD student at University of Lugano, in Switzerland. I am currently working on a research project and for a part of it I need to use some profiling information generated by existing LLVM tools from the latest version of LLVM. In more detail, I am trying to map profiling information generated from LLVM (Profiling with instrumentation) to IR.<br>
> (<a href="http://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation" rel="noreferrer" target="_blank">http://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation</a>)<br>
><br>
> Specifically, I want to annotate each Basic Block with its respective execution frequency. In order to accomplish that I am using the branch weight metadata annotated to conditional branches in the terminator instructions of Basic Blocks. These branch weight information as well as the entry counter of each function are generated by the already existing profiling tools of LLVM.<br>
><br>
> Are you aware of such frequency annotation for each BB already existing? Do you know whether this is feasible using the information of the branch weights and the entry counters of functions? I want to verify that I am doing it in the correct way, but unfortunately I have not come up with a clean way to do this. If you could give me any tips regarding that, it would be extremely helpful to me.<br>
><br>
> Thank you a lot in advance.<br>
><br>
> --<br>
> Best Regards,<br>
> Georgios Zacharopoulos<br>
><br>
> PhD student<br>
> Faculty of Informatics<br>
> Università della Svizzera italiana<br>
> Lugano, Switzerland<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best Regards,<div>Georgios Zacharopoulos</div><div><br></div><div><font size="1" face="georgia, serif">PhD student</font></div><div><font size="1" face="georgia, serif">Faculty of Informatics </font></div><div><font size="1" face="georgia, serif">Università della Svizzera italiana</font></div><div><font size="1" face="georgia, serif">Lugano, Switzerland</font></div></div></div></div></div></div></div></div></div></div></div>
</div>