From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28820 invoked by alias); 24 Aug 2011 10:12:23 -0000 Received: (qmail 28805 invoked by uid 22791); 24 Aug 2011 10:12:21 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Aug 2011 10:11:58 +0000 Received: by fxg11 with SMTP id 11so929744fxg.20 for ; Wed, 24 Aug 2011 03:11:56 -0700 (PDT) Received: by 10.223.58.13 with SMTP id e13mr7123009fah.80.1314180716471; Wed, 24 Aug 2011 03:11:56 -0700 (PDT) Received: from richards-thinkpad.stglab.manchester.uk.ibm.com (gbibp9ph1--blueice3n2.emea.ibm.com [195.212.29.84]) by mx.google.com with ESMTPS id y21sm708302faj.47.2011.08.24.03.11.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 03:11:55 -0700 (PDT) From: Richard Sandiford To: Bernd Schmidt Mail-Followup-To: Bernd Schmidt ,GCC Patches , richard.sandiford@linaro.org Cc: GCC Patches Subject: Re: [1/2] Rename across ebbs References: <4DDFF6F9.3090605@codesourcery.com> Date: Wed, 24 Aug 2011 11:21:00 -0000 In-Reply-To: <4DDFF6F9.3090605@codesourcery.com> (Bernd Schmidt's message of "Fri, 27 May 2011 19:09:45 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg01980.txt.bz2 Bernd Schmidt writes: > * regrename.c (struct du_head): Remove member terminated. > (create_new_chain): Don't initialize it. > (scan_rtx_reg): Don't set or test it, test the open_chains_set > bitmap instead. > (tick, this_tick): New global variables, moved out of > regrename_optimize. > (current_id, open_chains, closed_chains, open_chains_set, > live_in_chains, live_hard_regs): Reorder declarations. > (dump_def_use_chain): Move function earlier in the file. > (rename_chains): New static function, broken out of > regrename_optimize. > (regrename_optimize): Use it. Remove #if 0'ed code. The reindent operation seems to have introduced some weird formatting (due in some cases to the existing code not really following the rules). So: > +/* Process the closed chains starting with ALL_CHAINS and rename > + registers if possible. */ > +static void > +rename_chains (du_head_p all_chains) > +{ > + HARD_REG_SET unavailable; > + > + excess whitespace here. > + /* Iterate over elements in the chain in order to: > + 1. Count number of uses, and narrow the set of registers we can > + use for renaming. > + 2. Compute the superunion of register classes in this chain. */ original formatting was better: /* Iterate over elements in the chain in order to: 1. Count number of uses, and narrow the set of registers we can use for renaming. 2. Compute the superunion of register classes in this chain. */ > + if (has_preferred_class > + && (pass == 0) > + != TEST_HARD_REG_BIT > + (reg_class_contents[preferred_class], new_reg)) > + continue; The last two lines of the condition aren't indented properly. (I checked it wasn't just a diff artefact.) > + && ((pass == 0 > + && !TEST_HARD_REG_BIT > + (reg_class_contents[preferred_class], > + best_new_reg)) > + || tick[best_new_reg] > tick[new_reg])) Same thing with the TEST_HARD_REG_BIT argument here. OK otherwise, thanks. I suppose removing the terminated field is a (very) slight compile-time pessimisation in itself. We only set it when we were modifying the chain anyway, so there should be no cache pollution problems. And calling bitmap_bit_p is more expensive than a bitfield test on a structure that we're already looking at. The difference is nothing like enough to be a problem though, especially if it makes the other patch easier. Just saying in case anyone thought it wasn't being considered... Richard