From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22741 invoked by alias); 9 Oct 2015 16:08:27 -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 22731 invoked by uid 89); 9 Oct 2015 16:08:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Fri, 09 Oct 2015 16:08:25 +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 t99G8LEc001126; Fri, 9 Oct 2015 11:08:21 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t99G8Ls6001125; Fri, 9 Oct 2015 11:08:21 -0500 Date: Fri, 09 Oct 2015 16:08:00 -0000 From: Segher Boessenkool To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH] bb-reorder: Improve the simple algorithm for -Os (PR67864) Message-ID: <20151009160820.GA32545@gate.crashing.org> References: 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: 2015-10/txt/msg00997.txt.bz2 On Fri, Oct 09, 2015 at 11:29:16AM +0200, Richard Biener wrote: > I think the patch makes sense but it also raises a question for me - how > did we decide what edge gets EDGE_FALLTHRU when going out-of-cfglayout? Good question. I think it just tries to make "natural" control flow; I'll investigate. > And isn't _that_ mechanism then not part of basic-block reordering that > needs to be tweaked for choosing the EDGE_FALLTHRU as better? Yes. This patch uses the existing fallthrough for conditional branches, which seems to work best; but it still can significantly improve on unconditional branches. I'm sure there are better heuristics possible but I don't know them (and actually *solving* the problem isn't even polynomial of course). Segher