From patchwork Thu Jun 10 23:23:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 55277 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 A54CFB7D9E for ; Fri, 11 Jun 2010 09:23:19 +1000 (EST) Received: (qmail 22290 invoked by alias); 10 Jun 2010 23:23:18 -0000 Received: (qmail 22281 invoked by uid 22791); 10 Jun 2010 23:23:17 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 23:23:09 +0000 Received: by fg-out-1718.google.com with SMTP id e12so66433fga.8 for ; Thu, 10 Jun 2010 16:23:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.87.66.14 with SMTP id t14mr2138876fgk.64.1276212187293; Thu, 10 Jun 2010 16:23:07 -0700 (PDT) Received: by 10.86.63.9 with HTTP; Thu, 10 Jun 2010 16:23:07 -0700 (PDT) In-Reply-To: References: <20100610113521.GB562@kam.mff.cuni.cz> Date: Thu, 10 Jun 2010 16:23:07 -0700 Message-ID: Subject: Re: Move df_live and df_md bitmaps to own obstacks From: "H.J. Lu" To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, bonzini@gnu.org 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 On Thu, Jun 10, 2010 at 3:41 PM, H.J. Lu wrote: > On Thu, Jun 10, 2010 at 4:35 AM, Jan Hubicka wrote: >> Hi, >> this patch moves df_live and df_md bitmaps to own obstacks.  I believe those >> are all important df problems that depends on bitmap performance? >> >> Bootstrapped/regtested x86_64-linux (with df checking) >> OK? >> >> Honza >> >>        * df-problems.c (df_live_problem_data): Add live_bitmaps. >>        (df_live_alloc): Initialize problem data and live_osbtacks. >>        (df_live_finalize): Remove obstack, problem data; do not >>        clear all bitmaps. >>        (df_live_top_dump, df_live_bottom_dump): Do not dump old >>        data when not allocated. >>        (df_live_verify_solution_start): Do not allocate problem data. >>        (df_live_verify_solution_end): Check if out is allocated. >>        (struct df_md_problem_data): New structure. >>        (df_md_alloc): Allocate problem data. >>        (df_md_free): Free problem data; do not clear bitmaps. >> > > This caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44498 > We have if (!df_live_scratch) - df_live_scratch = BITMAP_ALLOC (NULL); + df_live_scratch = BITMAP_ALLOC (&problem_data->live_bitmaps); ... + bitmap_obstack_release (&problem_data->live_bitmaps); if (df_live_scratch) BITMAP_FREE (df_live_scratch); We are calling bitmap_obstack_free after bitmap_obstack_release is called. Does this patch make any senses? Index: df-problems.c =================================================================== --- df-problems.c (revision 160549) +++ df-problems.c (working copy) @@ -1645,8 +1645,8 @@ df_live_free (void) free (df_live->block_info); bitmap_obstack_release (&problem_data->live_bitmaps); - if (df_live_scratch) - BITMAP_FREE (df_live_scratch); + /* df_live_scratch is allocated from problem_data->live_bitmaps. */ + df_live_scratch = (bitmap) NULL; } BITMAP_FREE (df_live->out_of_date_transfer_functions); free (df_live);