This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Speed cfg_layout_duplicate_bb


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]