Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754819Ab3HET4T (ORCPT ); Mon, 5 Aug 2013 15:56:19 -0400 Received: from mail-ve0-f181.google.com ([209.85.128.181]:51671 "EHLO mail-ve0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754712Ab3HET4S (ORCPT ); Mon, 5 Aug 2013 15:56:18 -0400 MIME-Version: 1.0 In-Reply-To: <20130805194009.GZ17022@redhat.com> References: <1375721715.22073.80.camel@gandalf.local.home> <1375725328.22073.101.camel@gandalf.local.home> <20130805194009.GZ17022@redhat.com> Date: Mon, 5 Aug 2013 12:56:17 -0700 X-Google-Sender-Auth: evSCEeHgh-dB0-_Xvp2CkgWRTFM Message-ID: Subject: Re: [RFC] gcc feature request: Moving blocks into sections From: Linus Torvalds To: Marek Polacek Cc: Steven Rostedt , LKML , gcc , Ingo Molnar , Mathieu Desnoyers , "H. Peter Anvin" , Thomas Gleixner , David Daney , Behan Webster , Peter Zijlstra , Herbert Xu Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1332 Lines: 33 On Mon, Aug 5, 2013 at 12:40 PM, Marek Polacek wrote: > > FWIW, we also support hot/cold attributes for labels, thus e.g. > > if (bar ()) > goto A; > /* ... */ > A: __attribute__((cold)) > /* ... */ > > I don't know whether that might be useful for what you want or not though... Steve? That does sound like it might at least re-order the basic blocks better for your cases. Worth checking out, no? That said, I don't know what gcc actually does for that case. It may be that it just ends up trying to transfer that "cold" information to the conditional itself, which wouldn't work for our asm goto use. I hope/assume it doesn't do that, though, since the "cold" attribute would presumably also be useful for things like computed gotos etc - so it really isn't about the _source_ of the branch, but about that specific target, and the basic block re-ordering. Anyway, the exact implementation details may make it more or less useful for our special static key things. But it does sound like the right thing to do for static keys. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/