This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: const_double performance improvement
- From: Dale Johannesen <dalej at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Dale Johannesen <dalej at apple dot com>
- Date: Fri, 24 Jan 2003 16:39:22 -0800
- Subject: Patch: const_double performance improvement
The htab_eq function for const_double_htab looks at the mode, so the
hash function should too.
This reduced collisions from 63 to 3 in a small test. Bootstrapped and
tested on darwin.
2003-01-24 Dale Johannesen <dalej@apple.com>
* emit-rtl.c (const_double_htab_hash): Use mode in the hash.
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.307
diff -u -d -b -w -r1.307 emit-rtl.c
--- emit-rtl.c 21 Jan 2003 14:54:21 -0000 1.307
+++ emit-rtl.c 25 Jan 2003 00:32:18 -0000
@@ -229,7 +229,11 @@
if (GET_MODE (value) == VOIDmode)
h = CONST_DOUBLE_LOW (value) ^ CONST_DOUBLE_HIGH (value);
else
+ {
h = real_hash (CONST_DOUBLE_REAL_VALUE (value));
+ /* MODE is used in the comparison, so it should be in the hash.
*/
+ h ^= GET_MODE (value);
+ }
return h;
}