From: Martin Liska Date: Fri, 31 Aug 2018 11:37:09 +0000 (+0200) Subject: IPA ICF: make type cache a static field sem_item. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c72e55df00195f1c955e7ffdd76386613f69560;p=gcc.git IPA ICF: make type cache a static field sem_item. 2018-08-31 Martin Liska * ipa-icf.c (sem_item::add_type): Use sem_item::m_type_hash_cache. * ipa-icf.h: Move the cache from sem_item_optimizer to sem_item. From-SVN: r264014 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1fbcbd5bea5..62918c311ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-08-31 Martin Liska + + * ipa-icf.c (sem_item::add_type): Use + sem_item::m_type_hash_cache. + * ipa-icf.h: Move the cache from sem_item_optimizer + to sem_item. + 2018-08-31 Nathan Sidwell * doc/extend.texi (Backwards Compatibility): Remove implicit diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 39b96ba13be..8a6a7a3f32f 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -227,6 +227,8 @@ void sem_item::set_hash (hashval_t hash) m_hash_set = true; } +hash_map sem_item::m_type_hash_cache; + /* Semantic function constructor that uses STACK as bitmap memory stack. */ sem_function::sem_function (bitmap_obstack *stack) @@ -1587,7 +1589,7 @@ sem_item::add_type (const_tree type, inchash::hash &hstate) return; } - hashval_t *val = optimizer->m_type_hash_cache.get (type); + hashval_t *val = m_type_hash_cache.get (type); if (!val) { @@ -1607,7 +1609,7 @@ sem_item::add_type (const_tree type, inchash::hash &hstate) hstate2.add_int (nf); hash = hstate2.end (); hstate.add_hwi (hash); - optimizer->m_type_hash_cache.put (type, hash); + m_type_hash_cache.put (type, hash); } else hstate.add_hwi (*val); diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h index 622aebc00c0..a64b3852efb 100644 --- a/gcc/ipa-icf.h +++ b/gcc/ipa-icf.h @@ -281,6 +281,9 @@ private: /* Initialize internal data structures. Bitmap STACK is used for bitmap memory allocation process. */ void setup (bitmap_obstack *stack); + + /* Because types can be arbitrarily large, avoid quadratic bottleneck. */ + static hash_map m_type_hash_cache; }; // class sem_item class sem_function: public sem_item @@ -524,9 +527,6 @@ public: /* Gets a congruence class group based on given HASH value and TYPE. */ 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 m_type_hash_cache; private: /* For each semantic item, append hash values of references. */