[LLVMdev] Measuring performance overhead

Chris Lattner sabre at nondot.org
Sat Feb 26 20:34:51 PST 2005


On Sat, 26 Feb 2005, Tanu Sharma wrote:

> Thanks for the reply :-)
> I am actually looking for ways to determine "size" of code segment when the program is in native code.
> Any suggestions to do that ?

Compile it with llvm to a native .o or .exe file, then run 'size' on it?

E.g.:

llvm-gcc x.c -o a.out -Wl,-native
size ./a.out

-Chris


> Chris Lattner <sabre at nondot.org> wrote:
> On Fri, 25 Feb 2005, Tanu Sharma wrote:
>
>>
>> Hey,
>>
>> I have written a pass and wishes to measure its performance overhead
>> after running it over a program.I also wish to measure the size of code
>> segment once the program is in native code.What are the easy ways in
>> llvm to achieve this?Are there any tools available in llvm for the same
>
> I'm not sure specifically what you want, but you should just be able to
> compile the program with and without your pass (e.g. you could add it to
> gccas/ld and add an option to enable or disable it). Compile it both ways
> and compare the results?
>
>> ?What exactly is this llvm-prof ?
>
> llvm-prof is an interface to the a basic block, edge, and function
> profiler. llvm-prof is just a front-end that formats profile data for
> human consumption. If you look at the llvm/utils/profile.pl, you can play
> around with it.
>
> -Chris
>
>

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list