[LLVMdev] Profiling support in LLVM

Andrei Alvares logytech at gmail.com
Mon Mar 21 15:34:09 PDT 2011


Hi Najem,

  Our compiler group had a meeting sometime ago which we discussed how
to profile a simple program with gcc and llvm. You can find  our
discussion here:
http://www2.dcc.ufmg.br/laboratorios/llp/wiki/doku.php?id=blog:optmeetings:2009_05_13_-_profiling

  Please note that it is a very basic tutorial, with a simple example.
But it can be used as a first contact with llvm profiling framework. I
hope it can be useful.

  Best regards,
    Andrei

On Mon, Mar 21, 2011 at 7:19 PM, John Criswell <criswell at illinois.edu> wrote:
> Dear Najem,
>
> You might want to read the llvm-prof documentation if you haven't already:
> http://llvm.org/cmds/llvm-prof.html.  The documentation mentions a script in
> the utils directory that automates some of the profiling tasks for you.
>
> I suspect the way that llvm-prof works is to compile your whole program to a
> single LLVM bitcode file, run a transform on it, and then generate native
> code, link in the LLVM profiling run-time library, and then run the
> program.  You then use llvm-prof to analyze the original bitcode file and
> the output from running the program to get the report.  That's just a guess,
> though; I've never used llvm-prof myself.
>
> I bet looking at the script in the utils directory will shed light on how to
> use llvm-prof.
>
> -- John T.
>
>
> On 3/21/11 4:46 PM, Andrew Trick wrote:
>
> Hi Najem,
> On Mar 21, 2011, at 9:47 AM, NaJeM ErMeLeH wrote:
>
> I'm assisting my doctor who is doing a research and he wants to use the llvm
> compiler, my job is to profile build the benchmarks using llvm-prof.
>
> What i want to know is the following
>
> 1- does llvm support profile feedback optimizations!?
>
> Not yet. Please see Bob's proposal:
> http://article.gmane.org/gmane.comp.compilers.llvm.devel/37107/match=profile
>
> 2- when i've used the llvm-prof it's input is an object file (not binary as
> other compilers) my question is how could I profile a whole benchmark
> program using the llvm-prof ?
>
> I haven't done it, but I think the correct answer is to use llvm-ld to
> generate a single bitcode file, then run llvm-prof.
>
> 3- is there a way to print the spill code information (e.g. spill code count
> in a single function or basic block) ?
>
> -stats give you aggregate counts. Unfortunately, I don't know a way to do
> per-function reporting without using llvm-extract.
> You might be able to scrape -debug-only=spiller output for block info.
> -Andy
>
> your help is appreciated.
>
> regards,
> ~Najem
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list