From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111475 invoked by alias); 24 Sep 2015 16:39:05 -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 111377 invoked by uid 89); 24 Sep 2015 16:39:04 -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,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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; Thu, 24 Sep 2015 16:39: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 t8OGcxol003746; Thu, 24 Sep 2015 11:38:59 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t8OGcwPl003745; Thu, 24 Sep 2015 11:38:58 -0500 Date: Thu, 24 Sep 2015 17:22:00 -0000 From: Segher Boessenkool To: Steven Bosscher Cc: GCC Patches Subject: Re: [PATCH 2/4] bb-reorder: Add the "simple" algorithm Message-ID: <20150924163858.GA3427@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-09/txt/msg01885.txt.bz2 On Thu, Sep 24, 2015 at 06:03:33PM +0200, Steven Bosscher wrote: > On Thu, Sep 24, 2015 at 12:06 AM, Segher Boessenkool wrote: > > + /* First, collect all edges that can be optimized by reordering blocks: > > + simple jumps and conditional jumps, as well as the function entry edge. */ > > + > > + int n = 0; > > + edges[n++] = EDGE_SUCC (ENTRY_BLOCK_PTR_FOR_FN (cfun), 0); > > + > > + basic_block bb; > > + FOR_EACH_BB_FN (bb, cfun) > > + { > > + rtx_insn *end = BB_END (bb); > > + > > + if (computed_jump_p (end) || tablejump_p (end, NULL, NULL)) > > + continue; > > Should handle ASM jumps. Right, those are considered as optimisable now, although they are not. Will fix. > > + FOR_ALL_BB_FN (bb, cfun) > > + bb->aux = bb; > > Bit tricky for the ENTRY and EXIT blocks, that are not really basic > blocks. After the pass, EXIT should not end up pointing to itself. But it doesn't, the next line already takes care of it. Segher