From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 131044 invoked by alias); 19 Jul 2016 15:35:21 -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 130007 invoked by uid 89); 19 Jul 2016 15:35:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=*at, perfectly X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 19 Jul 2016 15:35:19 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u6JFZFic032102; Tue, 19 Jul 2016 10:35:15 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id u6JFZFoZ032096; Tue, 19 Jul 2016 10:35:15 -0500 Date: Tue, 19 Jul 2016 15:35:00 -0000 From: Segher Boessenkool To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Subject: Re: [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns Message-ID: <20160719153515.GB26941@gate.crashing.org> References: <019d5b4c3f6b8119e1511e33a16a8ea96078b094.1465347472.git.segher@kernel.crashing.org> <20160718163411.GA5741@gate.crashing.org> <20160719144602.GA26941@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg01154.txt.bz2 On Tue, Jul 19, 2016 at 04:49:26PM +0200, Bernd Schmidt wrote: > >But you need the profile to make even reasonably good decisions. > > I'm not worried about making cost decisions: as far as I'm concerned > it's perfectly fine for that. I'm worried about correctness - you can't > validly save registers inside a loop. Of course you can. It needs to be paired with a restore; and we do that just fine. Pretty much *all* implementations in the literature do this, fwiw. > So IMO there needs to be an > additional cfg-based check that verifies whether the bb where we want to > place parts of the prologue is guaranteed to be executed at most once. That is equivalent to not doing this optimisation *at all*. Segher