diff options
author | Andi Kleen <ak@linux.intel.com> | 2014-07-25 13:39:05 +0000 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2014-07-25 13:39:05 +0000 |
commit | 6d8eb96b448df0073941f48e8d0c6ded834b5da6 (patch) | |
tree | 4511c17b40b5c5e380fd3e722d314ee3a4201b6c /gcc/tree.h | |
parent | f54860ea9624d03dbcf06b5f804159f8d8bc536d (diff) | |
download | gcc-6d8eb96b448df0073941f48e8d0c6ded834b5da6.zip gcc-6d8eb96b448df0073941f48e8d0c6ded834b5da6.tar.gz gcc-6d8eb96b448df0073941f48e8d0c6ded834b5da6.tar.bz2 |
Add an abstract incremental hash data type
Some files in gcc, like lto or tree, do large scale incremential hashing.
The current jhash implementation of this could be likely improved
by using an incremential hash that does not do a full rehashing
for every new value added.
This patch adds a new "inchash" class that abstracts the internal
state of the hash. This makes it easier to plug in new hashes
and also cleans up the code a bit.
Right now it is just implemented in the same way as the old
iterative hash in tree.c. The previous iterative hash code
from tree.c moved into a new separate file. Also I fixed up all
users to include the new header.
It should not really significantly change any hashing by itself,
it's mostly a cleanup at this point.
v2: Remove begin. Add commutative interface.
Add merge hash interface. Add add_flag.
gcc/:
2014-07-25 Andi Kleen <ak@linux.intel.com>
* Makefile.in (OBJS): Add inchash.o.
(PLUGIN_HEADERS): Add inchash.h.
* ipa-devirt.c: Include inchash.h.
* lto-streamer-out.c: Dito.
* tree-ssa-dom.c: Dito.
* tree-ssa-pre.c: Dito.
* tree-ssa-sccvn.c: Dito.
* tree-ssa-tail-merge.c: Dito.
* asan.c: Dito.
* tree.c (iterative_hash_hashval_t): Move to ...
(iterative_hash_host_wide_int): Move to ...
* inchash.c: Here. New file.
* tree.h (iterative_hash_hashval_t): Move to ...
(iterative_hash_host_wide_int): Move to ...
* inchash.h: Here. New file.
gcc/lto/:
2014-07-25 Andi Kleen <ak@linux.intel.com>
* lto.c: Include inchash.h
From-SVN: r213054
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -4284,9 +4284,6 @@ extern int tree_floor_log2 (const_tree); extern unsigned int tree_ctz (const_tree); extern int simple_cst_equal (const_tree, const_tree); extern hashval_t iterative_hash_expr (const_tree, hashval_t); -extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t); -extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t); -extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t); extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT); extern int type_list_equal (const_tree, const_tree); extern int chain_member (const_tree, const_tree); |