<div dir="ltr">Hi All,<div><br></div><div>My apologies for the long winded post in advance.</div><div><br></div><div>I need to obtain branch data(execution count of each block would work as well) for my machine function pass. The catch is I am using LLVM 3.1(can't update to later revision due to external factors) with DragonEGG and cross compiling it with GCC 32 bit arm tool chain.</div><div><br></div><div>The only option I see is using "-insert-edge-profiling" with "--profile-loader". Because of complications with my toolchain, I am not really sure I can use it as it. If any of you have worked with this, can you point me to some/any documentation showing what happens in the backend when using these? </div><div><br></div><div>The only useful information I can find on these are from previous questions people have asked(<a href="https://groups.google.com/forum/#!topic/llvm-dev/vJ2wDsQY6a4">https://groups.google.com/forum/#!topic/llvm-dev/vJ2wDsQY6a4</a> being one of them). The steps from what I can understand are:</div><div><br></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">opt -insert-edge-profiling -O3 foo.bc -o foo.2.bc </span></div><div>run the compiled binary using llvm-prof after linking with lprofile_rt<br style="font-family:arial,helvetica,sans-serif;font-size:13px"><span style="font-family:arial,helvetica,sans-serif;font-size:13px">opt -profile-loader        -O3 foo.bc -o foo.opt.bc //the required info can be obtained using this pass.</span><br></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Because I cross compile the binary, I am using gem5 to run it. This means, I have a problem since I have an arm binary I need to execute and x86 llvm tool(llvm-prof in this case).Theoretically, I should be able to</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">a)</span><span style="font-size:13px;font-family:arial,helvetica,sans-serif">Compile the binary for host with the first pass(one with </span><span style="font-size:13px;font-family:arial,helvetica,sans-serif">opt -insert-edge-profiling) and run it using llvm-prof</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-size:13px;font-family:arial,helvetica,sans-serif">b) Compile again with arm backend  with only the second pass(</span><span style="font-size:13px;font-family:arial,helvetica,sans-serif">-profile-loader) </span></div><div><span style="font-size:13px;font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,helvetica,sans-serif">Since the llvm bit code should be architecture independent. Is this an option? Has anyone tried this?</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Regards,</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Deepak</span></div></div>