This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] cfgbuild.c: Speed up make_edges.
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 09 Mar 2005 09:34:22 -0700
- Subject: Re: [patch] cfgbuild.c: Speed up make_edges.
- Organization: Red Hat, Inc
- References: <20050307.204654.63111842.kazu@cs.umass.edu>
- Reply-to: law at redhat dot com
On Mon, 2005-03-07 at 20:46 -0500, Kazu Hirata wrote:
> Hi,
>
> Attached is a patch to speed up make_edges.
>
> find_many_sub_basic_blocks and make_edges are used to fix up CFG after
> non-CFG-aware changes are made, such as expansion from tree to RTL and
> insn splitting.
>
> The problem is that the current code also tries to fix up basic blocks
> that have not changed.
>
> The patch speeds up make_edges by skipping basic blocks that have not
> changed. Specifically, with the patch, make_edges skips those basic
> blocks with BLOCK_ORIGINAL.
>
> Here is a timing in seconds for five runs of ./cc1 -quiet -O2
> -fomit-frame-pointer -o /dev/null.
>
> original patched diff%
> ----------------------------------------------
> c-common.i 13.857 13.767 -0.649%
> combine.i 16.741 16.728 -0.077%
> fold-const.i 18.295 18.210 -0.464%
> reload1.i 11.958 11.956 -0.016%
> reload.i 11.859 11.840 -0.160%
> insn-attrtab.i 207.372 206.232 -0.549%
>
> #unchecked_make_edge 948010 948010 0.000%
> #cached_make_edge 1483573 759126 -48.831%
> #make_edge 1642690 1181173 -28.095%
>
> #foo is the number of times foo is called while compiling cc1-i files.
> Note that the number of times unchecked_make_edge is called stays
> unchanged with this patch.
>
> Tested on i686-pc-linux-gnu. OK to apply?
>
> Kazu Hirata
>
> 2005-03-08 Kazu Hirata <kazu@cs.umass.edu>
>
> * cfgbuild.c (state, STATE, SET_STATE,
> BLOCK_USED_BY_TABLEJUMP, FULL_STATE): Move just before
> make_edges.
> (make_edges): Speed up by skipping blocks with BLOCK_ORIGINAL.
> (find_basic_blocks): Set the state of each basic block to
> BLOCK_NEW.
This is fine.
Thanks,
Jeff