From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6908 invoked by alias); 25 Aug 2011 07:31:34 -0000 Received: (qmail 6899 invoked by uid 22791); 25 Aug 2011 07:31:32 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Aug 2011 07:31:18 +0000 Received: by gxk3 with SMTP id 3so1567452gxk.20 for ; Thu, 25 Aug 2011 00:31:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.193.21 with SMTP id q21mr514393ybf.136.1314257476557; Thu, 25 Aug 2011 00:31:16 -0700 (PDT) Received: by 10.150.57.5 with HTTP; Thu, 25 Aug 2011 00:31:16 -0700 (PDT) In-Reply-To: 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 09:30:00 -0000 Message-ID: Subject: Re: [PATCH, PR43864] Gimple level duplicate block cleanup. From: Richard Guenther To: Ian Lance Taylor Cc: Tom de Vries , Steven Bosscher , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg02026.txt.bz2 On Wed, Aug 24, 2011 at 9:00 PM, Ian Lance Taylor wrote: > Tom de Vries writes: > >> Do you have a moment to give a second look to a gimple CFG optimization?= =A0The >> 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.. =A0However, since > you ask, I did read through the patch, and it looks OK to me. =A0Since > 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". =A0POSIX reserves names ending with > "_t" when is #included. =A0Name 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. =A0This flag is enabled b= y default >> +at @option{-O2} and higher. =A0The 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. =A0I suggest something like: > > =A0Look for identical code sequences. =A0When found, replace one with a > =A0jump to the other. =A0This optimization is known as tail merging or > =A0cross jumping. =A0This flag is enabled [now same as above] Can you also add a --param for the maximum number of iterations you perform (16 sounds quite high for GCC bootstrap), I'd default it to 2 which seems to catch 99% of all cases. If you already committed the patch just do it as a followup please. Thanks, Richard. > > Thanks. > > Ian >