From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102039 invoked by alias); 10 Oct 2016 21:21:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102026 invoked by uid 89); 10 Oct 2016 21:21:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=virtually, _int_malloc, restoring, THanks X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Oct 2016 21:21:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6E7D6A6C5; Mon, 10 Oct 2016 21:21:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-144.phx2.redhat.com [10.3.116.144]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9ALLWmt006186; Mon, 10 Oct 2016 17:21:32 -0400 Subject: Re: [PATCH 4/5] shrink-wrap: Shrink-wrapping for separate components To: Segher Boessenkool References: <20160930102908.GB14933@gate.crashing.org> <20160930103456.GC14933@gate.crashing.org> Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com From: Jeff Law Message-ID: Date: Mon, 10 Oct 2016 21:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20160930103456.GC14933@gate.crashing.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00664.txt.bz2 On 09/30/2016 04:34 AM, Segher Boessenkool wrote: > [ whoops, message too big, resending with the attachment compressed ] > > On Tue, Sep 27, 2016 at 03:14:51PM -0600, Jeff Law wrote: >> With transposition issue addressed, the only blocker I see are some >> simple testcases we can add to the suite. They don't have to be real >> extensive. And one motivating example for the list archives, ideally >> the glibc malloc case. > > And here is the malloc testcase. > > A very important (for performance) function is _int_malloc, which starts > with [ ... ] THanks. What I think is important to note with this example is the bits that were pushed into the path with the sysmalloc/alloc_perturb calls. That's an unlikely path. We have to extrapolate a bit from the assembly provided. In the not separately shrink-wrapped version, we have a full prologue of stores and two instances of a full epilogue (though only one ever executes) provided. With separate shrink wrapping the (presumably) very cold path where we error has virtually no prologue/epilogue. That's probably a nop from a performance standpoint. More interesting is the path where we call sysmalloc/alloc_perturb, it's a cold path, but not as cold as the error path. We save/restore 4 regs in that case. Rather than a full prologue/epilogue. So there's clearly a savings there, though again, via the expect it's a cold path. Where we have to extrapolate is the hot path. Presumably on the hot path we're saving/restoring ~4 fewer registers. I haven't verified that, but that is kindof the whole point here. Thanks, Jeff