<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, May 13, 2016 at 8:35 AM fateme Hoseini via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div>Does LLVM dynamically run the program to obtain profiling information like branch weight?</div></div></blockquote><div><br></div><div>No, the profile information is either collected via instrumentation of the program or via external sampling profilers. It is then read back into the IR by the frontend or an optimization pass.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> if so, can we access the information regarding this run like the number of instructions that have been executed dynamically between two specific points of the program?</div></div></blockquote><div><br></div><div>If Manuel Rigger's suggestion doesn't work, maybe try Valgrind which can get these kinds of instruction counts?</div></div></div>