This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: basic-block and profile-based optimizing (was Re: New attribute"infrequent"?)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]