This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: New attribute "infrequent"?
- To: Jan Hubicka <jh at suse dot cz>
- Subject: Re: New attribute "infrequent"?
- From: Geert Bosch <bosch at gnat dot com>
- Date: Mon, 27 Aug 2001 12:14:32 -0400 (EDT)
- Cc: gcc at gcc dot gnu dot org, pfk at fuchs dot offl dot uni-jena dot de,libc-alpha at sources dot redhat dot com, aj at suse dot de
On Mon, 27 Aug 2001, Jan Hubicka wrote:
We can add an attribute (probably called "infrequent") to the functions. Such
attribute exhibits a hint, that given function is definitly outside performance
cirtical code, so gcc can:
1) optimize it for size
2) use for branch prediction purposes
3) propagate the information to other functions allways calling infrequent
4) once procedure splitting is implemented (if at all), it can move whole
function to infrequently executed section.
I would think we get most of the benefit already by recognizing "noreturn"
functions and all calls leading to those. Marking functions "infrequent" is
a much more fuzzy notion, and has therefore the risk of being counter-productive,
especially as functions may be used in an entirely different way by different
programs. The distributed cost of maintaining such attributes all over the place
seems to be way higher than the benefit of such an optimization.
-Geert