[LLVMdev] Profiling - basic block execution frequencies

Chris Lattner sabre at nondot.org
Mon Aug 22 22:21:45 PDT 2005


On Tue, 23 Aug 2005, David Blaikie wrote:

> I've read some small amounts of documentation including the Doxygen
> docs on the LLVM Profiling capabilities. I'm looking to extract basic
> block execution frequencies (I just need relative values within a
> function) in to a simplified custom format for my work (research in to
> instruction selection). The API seems geared more towards the use of
> profiling data in LLVM Passes and I was wondering if anyone could just
> give me a brief overview or point me in the direction of the right
> part of the docs on how to easily generate profiling data and use C++
> to interact with it and get what I need.

Check out the code in tools/llvm-prof.  llvm-prof is a thin wrapper around 
the profiling APIs the loads the data and prints it out for human 
consumption.  From this you can figure out the APIs and convert it to 
whatever interface you'd like.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list