[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pgcc in Deb

Martijn van Oosterhout <kleptog@cupid.suninternet.com> writes:

> I remember reading something about gcc having an option that would
> insert code to profile all the branches in a programs and save that
> data to disk. Then, next time you compiled it would read this data
> in and use it to decide how to arrange the code within a function
> optimally.
> Unfortunatly I can't find any reference to it right now.

`-fprofile-arcs' will compile a program instrumented to save this
information, and `-fbranch-probabilities' will use that to tell the
CPU what the probable outcome of each conditional branch will be.

The problem here is that you'll need some pretty "typical" testing
(preferable automatic) or else the profile data will be suspect (as is
the case with all profiling).

All in all, it is much work and the returns are probably pretty slim.

> The next level up is to analyse the call structure of a whole program
> and rearrange all the functions so that functions that call eachother
> tend to be near one another, [...]
> Apparently SGI has a tool that does this and someone was writing a
> GPL'd version called Grope. Unfortunatly I can't find anything about
> that either.

You're probably talking about GNU Rope. <URL:http://grope.nat.org/>
should be the canonical URL, but at the time of writing, it was down.


Reply to: