diff options
author | Jan Hubicka <jh@suse.cz> | 2006-08-21 01:53:11 +0000 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2006-08-21 01:53:11 +0000 |
commit | ea7dd536e34e8b9c237b52a63a2a0a69da5159da (patch) | |
tree | a77296eaee0dcde8be19fcb23b3aaf14b92825ff /gcc/bitmap.c | |
parent | 69f51ee6f1f8ca453c0e4ec234d982b96794e2c0 (diff) |
* tree-ssa-alias.c (eq_ptr_info, ptr_info_hash): New function.
(create_name_tags): Instead of quadratic checking use hashtable.
* bitmap.h: Include hashtab.h.
(bitmap_hash): Declare.
* bitmap.c (bitmap_hash): New function.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@116285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r-- | gcc/bitmap.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c index efc789a3211..4ac38b04c2b 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -1520,4 +1520,21 @@ bitmap_print (FILE *file, bitmap head, const char *prefix, const char *suffix) fputs (suffix, file); } +/* Compute hash of bitmap (for purposes of hashing). */ +hashval_t +bitmap_hash (bitmap head) +{ + bitmap_element *ptr; + BITMAP_WORD hash = 0; + int ix; + + for (ptr = head->first; ptr; ptr = ptr->next) + { + hash ^= ptr->indx; + for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) + hash ^= ptr->bits[ix]; + } + return (hashval_t)hash; +} + #include "gt-bitmap.h" |