From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21770 invoked by alias); 24 Aug 2011 19:01:10 -0000 Received: (qmail 21755 invoked by uid 22791); 24 Aug 2011 19:01:05 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gy0-f197.google.com (HELO mail-gy0-f197.google.com) (209.85.160.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Aug 2011 19:00:51 +0000 Received: by gyc15 with SMTP id 15so1936039gyc.8 for ; Wed, 24 Aug 2011 12:00:50 -0700 (PDT) Received: by 10.236.170.40 with SMTP id o28mr17189302yhl.57.1314212450285; Wed, 24 Aug 2011 12:00:50 -0700 (PDT) Received: by 10.236.170.40 with SMTP id o28mr17189266yhl.57.1314212450041; Wed, 24 Aug 2011 12:00:50 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2301:21c:25ff:fe14:8d86]) by mx.google.com with ESMTPS id a29sm1941149yhj.3.2011.08.24.12.00.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 12:00:49 -0700 (PDT) From: Ian Lance Taylor To: Tom de Vries Cc: Richard Guenther , Steven Bosscher , gcc-patches@gcc.gnu.org Subject: Re: [PATCH, PR43864] Gimple level duplicate block cleanup. References: <4DEF4408.4040001@codesourcery.com> <4DF24C2C.7080808@codesourcery.com> <4E1C3A19.8060706@codesourcery.com> <4E232ADD.3020803@codesourcery.com> <4E54AA90.1020809@codesourcery.com> Date: Thu, 25 Aug 2011 01:07:00 -0000 In-Reply-To: <4E54AA90.1020809@codesourcery.com> (Tom de Vries's message of "Wed, 24 Aug 2011 09:38:56 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2011-08/txt/msg02016.txt.bz2 Tom de Vries writes: > Do you have a moment to give a second look to a gimple CFG optimization? The > optimization removes duplicate basic blocks and reduces code size by 1-2%. > > The latest patch is posted at > http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01602.html. I'm not really the best person to look at this patch, since it applies to areas of the compiler with which I am less familiar.. However, since you ask, I did read through the patch, and it looks OK to me. Since Richi OK'ed it, this patch is OK with the following changes. > +typedef struct same_succ *same_succ_t; > +typedef const struct same_succ *const_same_succ_t; Don't name new types ending with "_t". POSIX reserves names ending with "_t" when is #included. Name these something else. > +typedef struct bb_cluster *bb_cluster_t; > +typedef const struct bb_cluster *const_bb_cluster_t; Same here. > +@item -ftree-tail-merge > +Merges identical blocks with same successors. This flag is enabled by default > +at @option{-O2} and higher. The run time of this pass can be limited using > +@option{max-tail-merge-comparisons} parameter. I think this text can be improved to be more meaningful to compiler users. I suggest something like: Look for identical code sequences. When found, replace one with a jump to the other. This optimization is known as tail merging or cross jumping. This flag is enabled [now same as above] Thanks. Ian