Implement coalesce list with hash table instead of linked list.
commitc3292d4288f004e58355d00106c0022fb3972cac
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Nov 2006 21:36:32 +0000 (30 21:36 +0000)
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Nov 2006 21:36:32 +0000 (30 21:36 +0000)
tree846178c38c493762bf802c9fd5ce7f67e1f92d30
parentb4fc673b1af63ac26fd65a6ae59a5e0fd44634a7
Implement coalesce list with hash table instead of linked list.

* tree-ssa-live.c (create_coalesce_list): Create a hash table.
(COALESCE_HASH_FN): New.  Define hash function.
(partition_pair_map_hash): New.  Hash value for a partition pair.
(partition_pair_map_eq): New.  Equality for hash pairs.
(create_coalesce_list): Create hash table.
(delete_coalesce_list): Free hash table.
(find_partition_pair): Find/create pairs in hash table.
(compare_pairs):  Sort pairs in ascending order now.
(num_coalesce_pairs): New.  Number of pairs in hash table.
(struct partition_pair_iterator): Iterator struct for pair table.
(first_partition_pair): Iterator function for first pair.
(end_partition_pair_p): Iterator function for end of iteration.
(next_partition_pair): Iterator function for next pair.
(FOR_EACH_PARTITION_PAIR): Macro for iterating over pairs.
(sort_coalesce_list): Sort pairs from hash table into an array.
(pop_best_coalesce): Take pairs from the array.
(dump_coalesce_list): Update to use hash table or sorted array.
* tree-ssa-live.h (struct partition_pair_d): Remove next field.
(struct coalesce_list_d): Add hash table related fields.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119378 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-ssa-live.c
gcc/tree-ssa-live.h