Simplify CFG copying tables
authorRichard Biener <rguenther@suse.de>
Wed, 21 Oct 2020 07:40:09 +0000 (09:40 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 21 Oct 2020 08:45:08 +0000 (10:45 +0200)
commit028a407463ce341487103abc877032384e6427bf
tree4f08d357d27880f5d5144b31fb8f15ba307cea46
parent4fa5dc951e9b22b61da8a4a5e0c1731d8b12a763
Simplify CFG copying tables

This simplifies the maps between original and new basic blocks and
loops as used for CFG copying.  Instead of using a pointer hash
table to allocated mapping entries use a hash_map with int_hash,
removing the indirection and code duplication.  We can use -1 and
-2 as empty/deleted values as those are not valid basic-block
indices or loop numbers.

2020-10-21  Richard Biener  <rguenther@suse.de>

* cfg.c (htab_bb_copy_original_entry): Remove.
(bb_copy_hasher): Likewise.
(bb_original, bb_copy, loop_copy): Use
hash_map<int_hash<int, -1, -2>, int>.
(original_copy_bb_pool): Remove.
(initialize_original_copy_tables): Adjust.
(reset_original_copy_tables): Likewise.
(free_original_copy_tables): Likewise.
(original_copy_tables_initialized_p): Likewise.
(copy_original_table_clear): Simplify.
(copy_original_table_set): Likewise.
(get_bb_original): Likewise.
(get_bb_copy): Likewise.
(get_loop_copy): Likewise.
gcc/cfg.c