This is the mail archive of the
mailing list for the GCC project.
Re: New attribute "infrequent"?
- To: mrs at windriver dot com, gcc at gcc dot gnu dot org
- Subject: Re: New attribute "infrequent"?
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Mon, 27 Aug 2001 14:47:18 -0700
- Newsgroups: linux.egcs
In article <200108272027.NAA28045@kankakee.wrs.com> you write:
>> Date: Mon, 27 Aug 2001 18:47:06 +0200
>> From: Jan Hubicka <email@example.com>
>> To: Ulrich Drepper <firstname.lastname@example.org>
>> Actually for enabling -Os, the attribute "infrequent" looks like
>> better choice to me:
>If 80% of the code is executed 10% of the time, does it make any sense
>to have people mark up the 80% of the code as infrequent? Or put
>another way, would it not make more sense to have the mark the
>frequent code instead?
I agree 100%.
Almost always, the programmer knows which parts of his programs are
really performance-critical. Having him/her mark _those_ parts (as
opposed to the bulk of his program) makes much more sense than trying to
say "this should be optimized for size" all over the place.
Obviously, things like profile-driven feedback compilation can add its
own information, so that the compiler can do part of this on its own.
Again, with profiling, it's usually much more productive to find the
(few) hotspots than try to mark the places that aren't active.