This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic-block and profile-based optimizing (was Re: New attribute"infrequent"?)
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Re: basic-block and profile-based optimizing (was Re: New attribute"infrequent"?)
- From: Andreas Jaeger <aj at suse dot de>
- Date: Fri, 31 Aug 2001 18:38:21 +0200
- Cc: Scott A Crosby <crosby at qwes dot math dot cmu dot edu>, Jan Hubicka <jh at suse dot cz>, gcc at gcc dot gnu dot org, pfk at fuchs dot offl dot uni-jena dot de
- References: <200108311617.MAA22404@makai.watson.ibm.com>
David Edelsohn <dje@watson.ibm.com> writes:
>>>>>> Andreas Jaeger writes:
>
> Andreas> Profile driven optimizations won't help directly in the case of
> Andreas> libraries where you can't profile. That's AFAIR why Jan suggested
> Andreas> this attribute.
>
> While one cannot profile and tune a system-wide library for each
> application's use, one can profile and optimize the library with
> representative *real* applications. Most library functions are used in
> standard ways, so profile-directed feedback tuning of the system libraries
> can be useful. The exceptional cases and error recovery paths are
> consistent. One needs to accept that the library is optimized only once
> for all potential applications, but that generic optimization can be
> effective for the system.
That's right.
I forgot the following (Honza stated it in one of his first emails) -
and this is IMO the key issue:
If GCC notices that a function is infrequently used, e.g. only used for
error handling, and normally not used, a call to this function can be
placed out of line, a branch to a block that contains such a call can
be predicted as not taken. But how does an application get the
information that a function of the library is infrequently used?
I don't see at the moment a way to get this information from one
object, the library, to a totally different one, the application -
especially when both are compiled and profiled by different developers
on different systems.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj