This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] hot/cold attributes on labels
- From: Jason Baron <jbaron at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Daney <ddaney at caviumnetworks dot com>
- Date: Wed, 20 Oct 2010 17:20:56 -0400
- Subject: Re: [RFC] hot/cold attributes on labels
- References: <20101019214337.GD2855@redhat.com> <4CBF5AAF.6050103@redhat.com>
On Wed, Oct 20, 2010 at 02:10:07PM -0700, Richard Henderson wrote:
> The motivation for this feature is to inform the compiler how
> it may wish to layout blocks following an asm goto.
>
> Since we can't annotate the asm goto with __builtin_expect,
> putting some information onto the label decl itself seems a
> reasonable solution.
>
> Note that one needs to use -O2 and not -Os in order to see the
> effects of this patch, since bb-reorder does nothing when
> optimizing for size -- despite any explicit option enabling block
> reordering. This is probably a bug. Of course, a size-sensitive
> block reordering pass would be Even Cooler.
>
> Comments?
>
>
Currently, I am seeing the 'unlikely' path moved out of line, under -02,
while using asm gotos - to the end of the function where the 'asm goto' is
used, (after the typical return path).
So this annotation would allow the unlikely/likely branches to be
grouped in hot/cold sections elsewhere?
more feedback after tyring the patch.
thanks,
-Jason