This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add hot/cold attributes for labels
- From: Richard Henderson <rth at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Baron <jbaron at redhat dot com>
- Date: Thu, 26 Jul 2012 14:41:08 -0700
- Subject: Add hot/cold attributes for labels
This is a patch I should have gone ahead and committed when I wrote it
against gcc 4.6, but... better late than never I suppose.
The Idea is to have some mechanism akin to __builtin_expect that can apply
to the edges created by asm goto. We tossed around possible syntax additions
to the asm construct, but nothing we came up with looked easy to use. In
the end it seemed fantastically cleaner to simply use the existing attribute
syntax and apply the existing hot/cold attributes to labels.
This patch by itself doesn't actually accomplish what we really want for use
in the kernel (which is why it didn't get committed before I guess), but it's
the user-visible portion that would enable further work.
Tested on x86_64 and committed.
r~