aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-icf.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-03-22 23:47:06 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-03-22 22:47:06 +0000
commit3ab933594942029c75a9f966ba949c8a0ead1de8 (patch)
treeb7bc6aaab7da123adf51a0177421b3b65768c4ef /gcc/ipa-icf.h
parent34d417be31db4900811d9294f4f42371d576d340 (diff)
downloadgcc-3ab933594942029c75a9f966ba949c8a0ead1de8.zip
gcc-3ab933594942029c75a9f966ba949c8a0ead1de8.tar.gz
gcc-3ab933594942029c75a9f966ba949c8a0ead1de8.tar.bz2
IPA ICF: include hash values of references.
* ipa-icf.c (sem_item::update_hash_by_addr_refs): New function. (sem_item::update_hash_by_local_refs): Likewise. (sem_variable::get_hash): Empty line is fixed. (sem_item_optimizer::execute): Include adding of hash references. (sem_item_optimizer::update_hash_by_addr_refs): New function. (sem_item_optimizer::build_hash_based_classes): Use local hash. * ipa-icf.h (sem_item::update_hash_by_addr_refs): New function. (sem_item::update_hash_by_local_refs): Likewise. From-SVN: r221576
Diffstat (limited to 'gcc/ipa-icf.h')
-rw-r--r--gcc/ipa-icf.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index 8245b54..cd21cac 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -189,6 +189,15 @@ public:
/* Dump symbol to FILE. */
virtual void dump_to_file (FILE *file) = 0;
+ /* Update hash by address sensitive references. */
+ void update_hash_by_addr_refs (hash_map <symtab_node *,
+ sem_item *> &m_symtab_node_map);
+
+ /* Update hash by computed local hash values taken from different
+ semantic items. */
+ void update_hash_by_local_refs (hash_map <symtab_node *,
+ sem_item *> &m_symtab_node_map);
+
/* Return base tree that can be used for compatible_types_p and
contains_polymorphic_type_p comparison. */
static bool get_base_types (tree *t1, tree *t2);
@@ -226,9 +235,13 @@ public:
/* A set with symbol table references. */
hash_set <symtab_node *> refs_set;
+ /* Hash of item. */
+ hashval_t hash;
+
+ /* Temporary hash used where hash values of references are added. */
+ hashval_t global_hash;
protected:
/* Cached, once calculated hash for the item. */
- hashval_t hash;
/* Accumulate to HSTATE a hash of constructor expression EXP. */
static void add_expr (const_tree exp, inchash::hash &hstate);
@@ -494,6 +507,9 @@ public:
private:
+ /* For each semantic item, append hash values of references. */
+ void update_hash_by_addr_refs ();
+
/* Congruence classes are built by hash value. */
void build_hash_based_classes (void);