From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19694 invoked by alias); 26 Mar 2012 19:02:31 -0000 Received: (qmail 19685 invoked by uid 22791); 26 Mar 2012 19:02:29 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Mar 2012 19:02:16 +0000 Received: by wibhq7 with SMTP id hq7so3814883wib.8 for ; Mon, 26 Mar 2012 12:02:14 -0700 (PDT) Received: by 10.180.24.66 with SMTP id s2mr21090297wif.7.1332788534765; Mon, 26 Mar 2012 12:02:14 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk. [82.133.89.107]) by mx.google.com with ESMTPS id 9sm70499417wid.2.2012.03.26.12.02.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Mar 2012 12:02:13 -0700 (PDT) From: Richard Sandiford To: Steven Bosscher Mail-Followup-To: Steven Bosscher ,GCC Patches , Ian Lance Taylor , rdsandiford@googlemail.com Cc: GCC Patches , Ian Lance Taylor Subject: Re: [patch] Split parts of cse_insn out to a few new functions References: Date: Mon, 26 Mar 2012 19:02:00 -0000 In-Reply-To: (Steven Bosscher's message of "Thu, 22 Mar 2012 00:09:59 +0100") Message-ID: <87mx736v9q.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (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: 2012-03/txt/msg01680.txt.bz2 Steven Bosscher writes: > On Wed, Mar 21, 2012 at 1:13 AM, Ian Lance Taylor wrote: >> On Tue, Mar 20, 2012 at 2:06 PM, Steven Bosscher wrote: >>> >>> This patch splits a couple of pieces of cse_insn out to new functions. >>> There are no functional changes, and no code generation differences as >>> far as I could tell on x86_64 (-m64 and -m32). > > Likewise for the attached patch. > >>> The purpose of the patch is and, loto hopefully make cse_insn easier >>> to understand. In a follow-up patch, I will make canonicalize_insn run >>> only once per insn (it currently, i.e. before and after this patch, >>> runs multiple times for CSE on extended basic blocks if a block is in >>> multiple extended basic blocks). > > That is what the attached patch does. > > Bootstrapped&tested on x86_64-unknown-linux-gnu. > OK for trunk? > > Ciao! > Steven > > * cse.c (cse_canonicalized_basic_blocks): New simple bitmap to > tag basic blocks that have already been traversed at least once, > so that all insns have been canonicalized. > (cse_insn): Call canonicalize_insn only if the basic block that > contains insn is visited for the first time. > (cse_extended_basic_block): After visiting all insns in a basic > block, mark the block in cse_canonicalized_basic_blocks. > (cse_main): Setup and destroy cse_canonicalized_basic_blocks. OK, thanks (without the microoptimisation, as you say). Out of curiosity, do you still see this bit as useful: /* We potentially will process this insn many times. Therefore, drop the REG_EQUAL note if it is equal to the SET_SRC of the unique set in INSN. Do not do so if the REG_EQUAL note is for a STRICT_LOW_PART, because cse_insn handles those specially. */ ? Does "many times" mean in CSE, or later? Richard