diff options
author | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-25 13:39:05 +0000 |
---|---|---|
committer | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-25 13:39:05 +0000 |
commit | 6b214d097a9e11d2b7ea9e141f21796baa0e39af (patch) | |
tree | 4511c17b40b5c5e380fd3e722d314ee3a4201b6c /gcc/ipa-devirt.c | |
parent | ab6e5665c356663d99a529db9e38bd79cecc8c35 (diff) | |
download | gcc-6b214d097a9e11d2b7ea9e141f21796baa0e39af.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213054 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 7c4151a1857..127d58d775d 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -118,6 +118,7 @@ along with GCC; see the file COPYING3. If not see #include "pointer-set.h" #include "target.h" #include "hash-table.h" +#include "inchash.h" #include "tree-pretty-print.h" #include "ipa-utils.h" #include "tree-ssa-alias.h" |