From patchwork Tue Jun 22 12:01:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Statistics finalization tweek Date: Tue, 22 Jun 2010 02:01:30 -0000 From: Jan Hubicka X-Patchwork-Id: 56464 Message-Id: <20100622120130.GB4034@kam.mff.cuni.cz> To: gcc-patches@gcc.gnu.org, rguenther@suse.de 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