From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89603 invoked by alias); 10 Oct 2018 10:29:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 89572 invoked by uid 89); 10 Oct 2018 10:29:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Oct 2018 10:29:08 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0D4B2AFBB; Wed, 10 Oct 2018 10:29:06 +0000 (UTC) Date: Wed, 10 Oct 2018 10:29:00 -0000 From: Richard Biener To: Segher Boessenkool cc: Ingo Molnar , Michael Matz , Borislav Petkov , gcc@gcc.gnu.org, Nadav Amit , Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, Masahiro Yamada , Sam Ravnborg , Alok Kataria , Christopher Li , Greg Kroah-Hartman , "H. Peter Anvin" , Jan Beulich , Josh Poimboeuf , Juergen Gross , Kate Stewart , Kees Cook , linux-sparse@vger.kernel.org, Peter Zijlstra , Philippe Ombredanne , Thomas Gleixner , virtualization@lists.linux-foundation.org, Linus Torvalds , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org, Andrew Morton Subject: Re: PROPOSAL: Extend inline asm syntax with size spec In-Reply-To: <20181010080324.GV29268@gate.crashing.org> Message-ID: References: <20181003213100.189959-1-namit@vmware.com> <20181007091805.GA30687@zn.tnic> <20181007132228.GJ29268@gate.crashing.org> <20181008073128.GL29268@gate.crashing.org> <20181009145330.GT29268@gate.crashing.org> <20181010072240.GB103159@gmail.com> <20181010080324.GV29268@gate.crashing.org> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-10/txt/msg00092.txt.bz2 On Wed, 10 Oct 2018, Segher Boessenkool wrote: > On Wed, Oct 10, 2018 at 09:22:40AM +0200, Ingo Molnar wrote: > > * Richard Biener wrote: > > > Can kernel folks give this a second and third thought please so we > > > don't implement sth that in the end won't satisfy you guys? > > > > So this basically passes '0 size' to the inliner, which should be better > > than passing in the explicit size, as we'd inevitably get it wrong > > in cases. > > The code immediately after this makes it size 1, even for things like > asm(""), I suppose this works better for the inliner. But that's a detail > (and it might change); the description says "consider this asm as minimum > length and cost for inlining decisions", which works for either 0 or 1. It was made 1 as otherwise the inliner happily explodes on void foo () { asm(""); foo(); } > > I also like 'size 0' for the reason that we tend to write assembly code > > and mark it 'inline' if we really think it matters to performance, > > so making it more likely to be inlined when used within another inline > > function is a plus as well. > > You can think of it as meaning "we want this asm inlined always", and then > whether that actually happens depends on if the function around it is > inlined or not. Richard.