diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-03-24 22:51:08 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-03-24 21:51:08 +0000 |
commit | 69f6b1f49ab388eeefb2c976d3335eaabb2b36c4 (patch) | |
tree | 606cbcfb4ebd88b0c41d37f545be4e2790c50e36 /gcc/ipa-icf.h | |
parent | e93870c12bbd5843b93447646c631eb8d6d99a9a (diff) | |
download | gcc-69f6b1f49ab388eeefb2c976d3335eaabb2b36c4.tar.gz |
IPA ICF: enhance hash value calculated in TU
* ipa-icf-gimple.h (return_with_result): Add missing colon to dump.
* ipa-icf.c (sem_function::get_hash): Hash new declaration properties.
(sem_item::add_type): New function.
(sem_function::hash_stmt): Add TREE_TYPE of gimple_op.
(sem_function::compare_polymorphic_p): Do not consider indirect calls.
(sem_item_optimizer::update_hash_by_addr_refs): Add ODR type to hash.
(sem_function::equals_wpa): Fix typo.
* ipa-icf.h (sem_item::add_type): New function.
(symbol_compare_hashmap_traits): Replace hashing of pointer with symbol
order.
Co-Authored-By: Martin Liska <mliska@suse.cz>
From-SVN: r221645
Diffstat (limited to 'gcc/ipa-icf.h')
-rw-r--r-- | gcc/ipa-icf.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h index cd21cacc94b..7eb9f27cb2f 100644 --- a/gcc/ipa-icf.h +++ b/gcc/ipa-icf.h @@ -96,12 +96,12 @@ struct symbol_compare_hashmap_traits: default_hashmap_traits hstate.add_int (v->m_references.length ()); for (unsigned i = 0; i < v->m_references.length (); i++) - hstate.add_ptr (v->m_references[i]->ultimate_alias_target ()); + hstate.add_int (v->m_references[i]->ultimate_alias_target ()->order); hstate.add_int (v->m_interposables.length ()); for (unsigned i = 0; i < v->m_interposables.length (); i++) - hstate.add_ptr (v->m_interposables[i]->ultimate_alias_target ()); + hstate.add_int (v->m_interposables[i]->ultimate_alias_target ()->order); return hstate.end (); } @@ -243,8 +243,10 @@ public: protected: /* Cached, once calculated hash for the item. */ - /* Accumulate to HSTATE a hash of constructor expression EXP. */ + /* Accumulate to HSTATE a hash of expression EXP. */ static void add_expr (const_tree exp, inchash::hash &hstate); + /* Accumulate to HSTATE a hash of type T. */ + static void add_type (const_tree t, inchash::hash &hstate); /* For a given symbol table nodes N1 and N2, we check that FUNCTION_DECLs point to a same function. Comparison can be skipped if IGNORED_NODES @@ -505,6 +507,8 @@ public: congruence_class_group *get_group_by_hash (hashval_t hash, sem_item_type type); + /* Because types can be arbitrarily large, avoid quadratic bottleneck. */ + hash_map<const_tree, hashval_t> m_type_hash_cache; private: /* For each semantic item, append hash values of references. */ |