This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [RFC] hot/cold attributes on labels


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


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