From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62502 invoked by alias); 9 Sep 2016 17:24:50 -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 62487 invoked by uid 89); 9 Sep 2016 17:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=evaluated, Perfect, perfect 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; Fri, 09 Sep 2016 17:24:48 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 06527C04D29C; Fri, 9 Sep 2016 17:24:47 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-111.phx2.redhat.com [10.3.116.111]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u89HOkqB022902; Fri, 9 Sep 2016 13:24:46 -0400 Subject: Re: [PATCH v2 0/9] Separate shrink-wrapping To: Segher Boessenkool References: <81710c02-05bf-fb65-dedc-8ba389c0d8e8@redhat.com> <20160826145001.GA21746@gate.crashing.org> <902e82bf-16c4-b302-ed44-90fb09b7c013@redhat.com> <20160909152806.GC28260@gate.crashing.org> <20160909165751.GB7827@gate.crashing.org> Cc: Bernd Schmidt , gcc-patches@gcc.gnu.org From: Jeff Law Message-ID: <4630090d-7ead-9ea0-2231-414254914ed7@redhat.com> Date: Fri, 09 Sep 2016 17:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160909165751.GB7827@gate.crashing.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00526.txt.bz2 On 09/09/2016 10:57 AM, Segher Boessenkool wrote: > On Fri, Sep 09, 2016 at 10:48:30AM -0600, Jeff Law wrote: >> and even allows them to be executed more than once, if that is >>> cheaper. >> This is the part that I'm still struggling with. > > The usual example: > > 1 > |\ > | \ > | 2 > | / > |/ > 3 > |\ > | \ > | 4 > | / > |/ > 5 > > where 2 and 4 need a certain prologue component (and the rest doesn't). Perfect. So this is consistent with one of the ideas I was starting to form. I'm going to stay in the PRE world because it's model is so damn close to what you're doing. PRE minimizes expression evaluations on paths *without* introducing evaluations on paths that didn't already have one. So if we pretend we had some expression evaluated in 2 & 4. The path 1->2->3->4 has two evaluations of the expression, but PRE can't really do anything here. We can't hoist the evaluation into a better spot as doing so would introduce evaluations on paths that didn't have one before. 2 & 4 are the proper locations for that expression evaluation. And the same applies to separate shrink wrapping. 2 & 4 are the right place. It's all so clear now. I'll note that duplicating 3 into 3' and redirecting the edge 2->3 to 2->3' allows us to do better PRE and prologue insertion. But I don't think that's a requirement for you to go forward :-) Anyway, it's all clear now. Thanks so much for that example. Jeff