This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Q: Profile-directed optimizations
Lassi A. Tuura writes:
> |> Some folks might also claim #2. I'm not convinced either way on whether
> |> or not profile directed feedback helps real code.
>
> I don't know about "normal" code, but I could imagine that for C++ the
> impact could be signficant if the profiler information is comprehensive
> enough to let compiler reason about polymorphic features, such as
> optimising virtual function calls. For example, if at some call site
> the calls always or sufficiently often end up in one particular
> function, compiler could turn it to a quick check and inlined virtual
> function body (plus a fallback to a regular virtual call).
>
> I believe much research has been done on this in the experimental
> compiler projects at universities (I don't remember the names right now
> and don't have access to my archives, but I can dig them up if somebody
> wants). Some of them are whole program optimisations, though.
One interesting project to look at is Cecil at U of Washington. Their
vortex compiler does this sort of thing for Cecil/C++/Modula-3. It can
hardly be called light weight though.
A very good description of polymorphic call optimisation is in Jeff
Dean's Ph. D. thesis which you can find at
http://www.cs.washington.edu/research/projects/cecil/www/Papers/jdean-thesis.html.
CLOS implementors have been optimizing these kind of things for years
too.
Lieven