This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Speed up gimple_tree_eq with release checking
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Dec 2010 17:30:18 +0100
- Subject: Re: [PATCH] Speed up gimple_tree_eq with release checking
- References: <alpine.LNX.2.00.1012081511520.23074@zhemvz.fhfr.qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 08, 2010 at 03:14:13PM +0100, Richard Guenther wrote:
>
> The gimplifier is still one part of the compiler that is comparatively
> slow. Looking at profiles lookup_tmp_var and friends stick out, the
> following makes expensive rehashing for assertion purposes conditional
> on checking.
>
> Applied as obvious.
It should have been gcc_checking_assert instead...
> 2010-12-08 Richard Guenther <rguenther@suse.de>
>
> * gimplify.c (gimple_tree_eq): Assert hashes are equal only
> when checking is enabled.
>
> Index: gcc/gimplify.c
> ===================================================================
> *** gcc/gimplify.c (revision 167583)
> --- gcc/gimplify.c (working copy)
> *************** gimple_tree_eq (const void *p1, const vo
> *** 145,153 ****
> --- 145,155 ----
> if (!operand_equal_p (t1, t2, 0))
> return 0;
>
> + #ifdef ENABLE_CHECKING
> /* Only allow them to compare equal if they also hash equal; otherwise
> results are nondeterminate, and we fail bootstrap comparison. */
> gcc_assert (gimple_tree_hash (p1) == gimple_tree_hash (p2));
> + #endif
>
> return 1;
> }
Jakub