This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Speed up gimple_tree_eq with release checking
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Dec 2010 15:14:13 +0100 (CET)
- Subject: [PATCH] Speed up gimple_tree_eq with release checking
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.
Of course I've always found this poor mans CSE during gimplification
somewhat odd ...
Richard.
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;
}