From patchwork Thu Jun 23 19:32:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 101678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 169B3B6F8A for ; Fri, 24 Jun 2011 05:32:44 +1000 (EST) Received: (qmail 3068 invoked by alias); 23 Jun 2011 19:32:42 -0000 Received: (qmail 3057 invoked by uid 22791); 23 Jun 2011 19:32:41 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 19:32:23 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5NJWMGw032248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jun 2011 15:32:22 -0400 Received: from toll.yyz.redhat.com (toll.yyz.redhat.com [10.15.16.165]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5NJWKT3009198 for ; Thu, 23 Jun 2011 15:32:21 -0400 Message-ID: <4E0394C3.4060203@redhat.com> Date: Thu, 23 Jun 2011 15:32:19 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 To: gcc-patches Subject: [lra] some cleaning up to speed up LRA X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The following patch removes a code used for some experiments in pseudo live range splitting during the assignment sub-pass and, as consequence, speeds LRA up. The patch was successfully bootstrapped on x86-64. 2011-06-23 Vladimir Makarov * lra-int.h (struct lra_bb_info, lra_bb_info): Remove. * lra.c (lra_bb_info, init_bb_info, finish_bb_info): Remove. (lra): Remove calls of init_bb_info and finish_bb_info. * lra-lives.c (live_regs): Remove. (make_hard_regno_born, make_pseudo_live, make_pseudo_dead): Don't update live_regs. (process_bb_lives): Ditto. Don't set up lra_bb_info. (lra_create_live_ranges): Don't initialize/finalize live_regs. Index: lra.c =================================================================== --- lra.c (revision 175313) +++ lra.c (working copy) @@ -45,35 +45,6 @@ along with GCC; see the file COPYING3. #include "lra-int.h" #include "df.h" -/* Info about BBs used by several LRA files. Remember that we never - create new BBs during LRA. */ -struct lra_bb_info *lra_bb_info; - -/* Allocate and initialize the BB info. */ -static void -init_bb_info (void) -{ - basic_block bb; - - lra_bb_info = (struct lra_bb_info *) xmalloc (sizeof (struct lra_bb_info) - * last_basic_block); - FOR_EACH_BB (bb) - bitmap_initialize (&lra_bb_info[bb->index].live_in_regs, ®_obstack); -} - -/* Finish and free the BB info. */ -static void -finish_bb_info (void) -{ - basic_block bb; - - FOR_EACH_BB (bb) - bitmap_clear (&lra_bb_info[bb->index].live_in_regs); - free (lra_bb_info); -} - - - /* Hard registers currently not available for allocation. It can changed after some registers become not eliminable. */ HARD_REG_SET lra_no_alloc_regs; @@ -2041,7 +2012,6 @@ lra (FILE *f) lra_dump_file = f; - init_bb_info (); init_insn_recog_data (); #ifdef ENABLE_CHECKING @@ -2141,7 +2111,6 @@ lra (FILE *f) lra_live_ranges_finish (); lra_contraints_finish (); finish_reg_info (); - finish_bb_info (); bitmap_clear (&lra_constraint_insn_stack_bitmap); VEC_free (rtx, heap, lra_constraint_insn_stack); finish_insn_recog_data (); Index: lra-int.h =================================================================== --- lra-int.h (revision 175313) +++ lra-int.h (working copy) @@ -48,19 +48,6 @@ lra_get_preferred_class (int regno) return reg_preferred_class (regno); } -/* Info about BBs used by several LRA files. */ -struct lra_bb_info -{ - /* DFA creates a bit different data (DF_LR_IN) than we need for LRA - live range splitting. E.g. DF_LR_IN might be not accurate for BB - having EH predecessors. */ - bitmap_head live_in_regs; -}; - -/* Info about BBs used by several LRA files. Remember that we never - create new BBs during LRA. */ -extern struct lra_bb_info *lra_bb_info; - typedef struct lra_live_range *lra_live_range_t; /* The structure describes program points where a given pseudo lives. Index: lra-lives.c =================================================================== --- lra-lives.c (revision 175313) +++ lra-lives.c (working copy) @@ -72,10 +72,6 @@ static sparseset pseudos_live; /* Set of hard regs (except eliminable ones) currently live. */ static HARD_REG_SET hard_regs_live; -/* Another representation of living pseudos and hard registers at the - current point. */ -static bitmap_head live_regs; - /* Set of pseudos and hard registers start living/dying. */ static sparseset start_living, start_dying; @@ -283,7 +279,6 @@ make_hard_regno_born (int regno) || TEST_HARD_REG_BIT (hard_regs_live, regno)) return; SET_HARD_REG_BIT (hard_regs_live, regno); - bitmap_set_bit (&live_regs, regno); sparseset_set_bit (start_living, regno); EXECUTE_IF_SET_IN_SPARSESET (pseudos_live, i) SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno); @@ -300,7 +295,6 @@ make_hard_regno_dead (int regno) gcc_assert (regno < FIRST_PSEUDO_REGISTER); sparseset_set_bit (start_dying, regno); CLEAR_HARD_REG_BIT (hard_regs_live, regno); - bitmap_clear_bit (&live_regs, regno); } /* Mark pseudo REGNO as currently living, update conflicting hard @@ -314,7 +308,6 @@ mark_pseudo_live (int regno) gcc_assert (regno >= FIRST_PSEUDO_REGISTER); gcc_assert (! sparseset_bit_p (pseudos_live, regno)); sparseset_set_bit (pseudos_live, regno); - bitmap_set_bit (&live_regs, regno); IOR_HARD_REG_SET (lra_reg_info[regno].conflict_hard_regs, hard_regs_live); if ((complete_info_p || lra_get_regno_hard_regno (regno) < 0) @@ -335,7 +328,6 @@ mark_pseudo_dead (int regno) gcc_assert (regno >= FIRST_PSEUDO_REGISTER); gcc_assert (sparseset_bit_p (pseudos_live, regno)); sparseset_clear_bit (pseudos_live, regno); - bitmap_clear_bit (&live_regs, regno); sparseset_set_bit (start_dying, regno); if (complete_info_p || lra_get_regno_hard_regno (regno) < 0) { @@ -488,16 +480,12 @@ process_bb_lives (basic_block bb) reg_live_out = DF_LR_OUT (bb); sparseset_clear (pseudos_live); - bitmap_clear (&live_regs); REG_SET_TO_HARD_REG_SET (hard_regs_live, reg_live_out); AND_COMPL_HARD_REG_SET (hard_regs_live, eliminable_regset); AND_COMPL_HARD_REG_SET (hard_regs_live, lra_no_alloc_regs); EXECUTE_IF_SET_IN_BITMAP (reg_live_out, 0, j, bi) if (j >= FIRST_PSEUDO_REGISTER) mark_pseudo_live (j); - else if (! TEST_HARD_REG_BIT (lra_no_alloc_regs, j) - && ! TEST_HARD_REG_BIT (eliminable_regset, j)) - bitmap_set_bit (&live_regs, j); freq = REG_FREQ_FROM_BB (bb); @@ -679,10 +667,6 @@ process_bb_lives (basic_block bb) add_reg_note (curr_insn, REG_UNUSED, regno_reg_rtx[j]); } - /* It is important to call it before processing EH return data - regnos. */ - bitmap_copy (&lra_bb_info[bb->index].live_in_regs, &live_regs); - #ifdef EH_RETURN_DATA_REGNO if (bb_has_eh_pred (bb)) for (j = 0; ; ++j) @@ -947,7 +931,6 @@ lra_create_live_ranges (bool all_p) lra_hard_reg_usage[hard_regno] += lra_reg_info[i].freq; } lra_free_copies (); - bitmap_initialize (&live_regs, ®_obstack); pseudos_live = sparseset_alloc (max_regno); start_living = sparseset_alloc (max_regno); start_dying = sparseset_alloc (max_regno); @@ -968,7 +951,6 @@ lra_create_live_ranges (bool all_p) sparseset_free (start_dying); sparseset_free (start_living); sparseset_free (pseudos_live); - bitmap_clear (&live_regs); compress_live_ranges (); }