From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119857 invoked by alias); 17 May 2016 22:23:07 -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 119832 invoked by uid 89); 17 May 2016 22:23:06 -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=forwarder, Hx-languages-length:1877, five 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, 17 May 2016 22:23:03 +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 u4HMMwm3012112; Tue, 17 May 2016 17:22:58 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id u4HMMvZ9012111; Tue, 17 May 2016 17:22:57 -0500 Date: Tue, 17 May 2016 22:23:00 -0000 From: Segher Boessenkool To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before Message-ID: <20160517222254.GA5146@gate.crashing.org> References: <213485283eede9da12b217737d95fc8f5c4be442.1463428211.git.segher@kernel.crashing.org> <1831730.xXXSthoG5j@polaris> <20160517084654.GB18363@gate.crashing.org> <20909191.oPg4YIUu4L@polaris> <20160517091758.GC18363@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160517091758.GC18363@gate.crashing.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01292.txt.bz2 On Tue, May 17, 2016 at 04:17:58AM -0500, Segher Boessenkool wrote: > On Tue, May 17, 2016 at 11:08:53AM +0200, Eric Botcazou wrote: > > > How would it? The shrink-wrapping algorithms do not much care how you > > > write your control flow. The only things I can think of are drastic > > > things like removing some dead code, or converting a switch to a direct > > > jump, but those had better be done for the immediately preceding passes > > > already (register allocation). > > > > But the compiler didn't wait until after shrink-wrapping to emit multiple > > epilogues and can still do that w/o shrink-wrapping. > > It will only ever generate a single epilogue (unless you also count > sibcall epilogues), and that is done after shrink-wrapping. Or you mean > something else and I just don't see it. > > > > I can put back a cleanup_cfg (0) in front if that seems less tricky > > > (or just safer)? > > > > I think you need to evaluate the effects of the change on a set of sources. > > Yeah I'll do that, thanks for the idea. I built cross-compilers for 30 targets, and built Linux with that. 6 of those failed for unrelated reasons. Of the 24 that do build, five show a few insns difference between having a cleanup_cfg before shrink-wrapping or not (CLEANUP_EXPENSIVE made no difference there). These targets are s390, blackfin, m68k, mn10300, nios2. It turns out that prepare_shrink_wrap *does* care about block structure: namely, it only moves insns from the "head" block to a successor. It then makes a difference when the cleanup_cfg can merge two successor blocks (say, the first is a forwarder block). This happens quite seldomly. So, shall I put a cleanup_cfg back before shrink-wrapping? [ I'm now also looking at what patch #3 (and #2) change; also small stuff ]. Segher