This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Speed cfg_layout_duplicate_bb
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Brad Lucier <lucier at math dot purdue dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, feeley at iro dot umontreal dot ca
- Date: Sun, 09 Mar 2003 19:37:03 -0800
- Subject: Re: PATCH: Speed cfg_layout_duplicate_bb
- References: <200303100319.h2A3JZe15182@banach.math.purdue.edu>
Brad Lucier <lucier at math dot purdue dot edu> writes:
> This is Michael Matz's patch to remove the quadratic behavior in
> make_edge when adding a new basic block.
Do I understand correctly that the issue is, when called from
cfg_layout_duplicate_bb we know definitively that the edge cannot
already exist, but make_edge looks for it anyway? And the lookup
algorithm used is slow in the event of a cache miss?
> It was bootstrapped and regtested on alphaev6-unknown-linux-gnu.
> Although there were some changes in the results, I don't think that
> they're related to the patch---I've been having strange, seemingly
> arbitrary regression changes.
I wouldn't worry about it - it's difficult to see how those could be
related. If you feel _really_ paranoid, construct two trees checked
out of CVS at the exact same time with no local modifications, apply
the patch to one of them, and run the testsuite against both.
> * cfg.c (unchecked_make_edge): New. Break out from ...
> (cached_make_edge): Here. Call unchecked_make_edge.
> * cfglayout.c (cfg_layout_dupicate_bb): Call unchecked_make_edge
> instead of make_edge.
> * basic_block.h (unchecked_make_edge): Declare.
This is OK if my understanding above is correct. If that's not right,
please explain what's going on.
zw