From patchwork Tue Jun 22 12:01:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 56464 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 4595DB6F07 for ; Tue, 22 Jun 2010 22:01:45 +1000 (EST) Received: (qmail 8418 invoked by alias); 22 Jun 2010 12:01:42 -0000 Received: (qmail 8299 invoked by uid 22791); 22 Jun 2010 12:01:41 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jun 2010 12:01:32 +0000 Received: from localhost (occam.ms.mff.cuni.cz [195.113.18.121]) by nikam.ms.mff.cuni.cz (Postfix) with ESMTP id 9D3059AC7CC; Tue, 22 Jun 2010 14:01:30 +0200 (CEST) Received: by localhost (Postfix, from userid 16202) id 96EB45641A7; Tue, 22 Jun 2010 14:01:30 +0200 (CEST) Date: Tue, 22 Jun 2010 14:01:30 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Statistics finalization tweek Message-ID: <20100622120130.GB4034@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Hi, looking into callgrind, one of most common callers of htab_traverse turns out to be statistics (even when it is disabled). This is because we call statistics_fini_pass for every function after every IPA pass rather than just once that I think should be sufficient ;) I wonder why we need to walk the table all the time? Bootstrapped/regtested x86_64-linux, OK? Honza * passes.c (execute_function_todo): Move call of statistics_fini_pass to ... (execute_todo) ... this one. Index: passes.c =================================================================== --- passes.c (revision 160988) +++ passes.c (working copy) @@ -1175,8 +1175,6 @@ execute_function_todo (void *data) if (!flags) return; - statistics_fini_pass (); - /* Always cleanup the CFG before trying to update SSA. */ if (flags & TODO_cleanup_cfg) { @@ -1288,6 +1286,8 @@ execute_todo (unsigned int flags) /* Inform the pass whether it is the first time it is run. */ first_pass_instance = (flags & TODO_mark_first_instance) != 0; + statistics_fini_pass (); + do_per_function (execute_function_todo, (void *)(size_t) flags); /* Always remove functions just as before inlining: IPA passes might be