GCC Middle and Back End API Reference
ipa-icf.h
Go to the documentation of this file.
1/* Interprocedural semantic function equality pass
2 Copyright (C) 2014-2024 Free Software Foundation, Inc.
3
4 Contributed by Jan Hubicka <hubicka@ucw.cz> and Martin Liska <mliska@suse.cz>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 3, or (at your option) any later
11version.
12
13GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22namespace ipa_icf {
23class sem_item;
24
25/* Congruence class encompasses a collection of either functions or
26 read-only variables. These items are considered to be equivalent
27 if not proved the opposite. */
29{
30public:
31 /* Congruence class constructor for a new class with _ID. */
32 congruence_class (unsigned int _id): in_worklist (false), id (_id),
34 {
35 }
36
37 /* Destructor. */
39 {
40 }
41
42 /* Dump function prints all class members to a FILE with an INDENT. */
43 void dump (FILE *file, unsigned int indent = 0) const;
44
45 /* Returns true if there's a member that is used from another group. */
46 bool is_class_used (void);
47
48 /* Flag is used in case we want to remove a class from worklist and
49 delete operation is quite expensive for
50 the data structure (linked list). */
52
53 /* Vector of all group members. */
54 auto_vec <sem_item *> members;
55
56 /* Global unique class identifier. */
57 unsigned int id;
58
59 /* Total number of references to items of this class. */
61};
62
63/* Semantic item type enum. */
69
70/* Class is container for address references for a symtab_node. */
71
73{
74public:
75 /* Constructor. */
77
78 /* Destructor. */
80 {
81 m_references.release ();
82 m_interposables.release ();
83 }
84
85 /* Vector of address references. */
87
88 /* Vector of interposable references. */
90};
91
92/* Hash traits for symbol_compare_collection map. */
93
94struct symbol_compare_hash : nofree_ptr_hash <symbol_compare_collection>
95{
96 static hashval_t
98 {
99 inchash::hash hstate;
100 hstate.add_int (v->m_references.length ());
101
102 for (unsigned i = 0; i < v->m_references.length (); i++)
103 hstate.add_int (v->m_references[i]->ultimate_alias_target ()->order);
104
105 hstate.add_int (v->m_interposables.length ());
106
107 for (unsigned i = 0; i < v->m_interposables.length (); i++)
108 hstate.add_int (v->m_interposables[i]->ultimate_alias_target ()->order);
109
110 return hstate.end ();
111 }
112
113 static bool
115 {
116 if (a->m_references.length () != b->m_references.length ()
117 || a->m_interposables.length () != b->m_interposables.length ())
118 return false;
119
120 for (unsigned i = 0; i < a->m_references.length (); i++)
121 if (a->m_references[i]->equal_address_to (b->m_references[i]) != 1)
122 return false;
123
124 for (unsigned i = 0; i < a->m_interposables.length (); i++)
125 if (!a->m_interposables[i]->semantically_equivalent_p
126 (b->m_interposables[i]))
127 return false;
128
129 return true;
130 }
131};
132
133/* Semantic item usage pair. */
135{
136public:
137 /* Constructor for key value pair, where _ITEM is key and _INDEX is a target. */
138 sem_usage_pair (sem_item *_item, unsigned int _index);
139
140 /* Target semantic item where an item is used. */
142
143 /* Index of usage of such an item. */
144 unsigned int index;
145};
146
147struct sem_usage_pair_hash : pointer_hash <sem_usage_pair>
148{
149 static inline hashval_t hash (sem_usage_pair *);
150 static inline bool equal (sem_usage_pair *, sem_usage_pair *);
151};
152
153inline hashval_t
155{
156 inchash::hash hstate;
157
158 hstate.add_ptr (pair->item);
159 hstate.add_int (pair->index);
160
161 return hstate.end ();
162}
163
164inline bool
166{
167 return p1->item == p2->item && p1->index == p2->index;
168}
169
172
173typedef std::pair<symtab_node *, symtab_node *> symtab_pair;
174
175/* Semantic item is a base class that encapsulates all shared functionality
176 for both semantic function and variable items. */
178{
179public:
180 /* Semantic item constructor for a node of _TYPE, where STACK is used
181 for bitmap memory allocation. */
182 sem_item (sem_item_type _type, bitmap_obstack *stack);
183
184 /* Semantic item constructor for a node of _TYPE, where STACK is used
185 for bitmap memory allocation. The item is based on symtab node _NODE. */
186 sem_item (sem_item_type _type, symtab_node *_node, bitmap_obstack *stack);
187
188 virtual ~sem_item ();
189
190 /* Dump function for debugging purpose. */
191 DEBUG_FUNCTION void dump (void);
192
193 /* Semantic item initialization function. */
194 virtual void init (ipa_icf_gimple::func_checker *) = 0;
195
196 /* Add reference to a semantic TARGET. */
197 void add_reference (ref_map *map, sem_item *target);
198
199 /* Fast equality function based on knowledge known in WPA. */
200 virtual bool equals_wpa (sem_item *item,
201 hash_map <symtab_node *, sem_item *> &ignored_nodes) = 0;
202
203 /* Returns true if the item equals to ITEM given as argument. */
204 virtual bool equals (sem_item *item,
205 hash_map <symtab_node *, sem_item *> &ignored_nodes) = 0;
206
207 /* References independent hash function. */
208 virtual hashval_t get_hash (void) = 0;
209
210 /* Set new hash value of the item. */
211 void set_hash (hashval_t hash);
212
213 /* Merges instance with an ALIAS_ITEM, where alias, thunk or redirection can
214 be applied. */
215 virtual bool merge (sem_item *alias_item) = 0;
216
217 /* Dump symbol to FILE. */
218 virtual void dump_to_file (FILE *file) = 0;
219
220 /* Update hash by address sensitive references. */
222 sem_item *> &m_symtab_node_map);
223
224 /* Update hash by computed local hash values taken from different
225 semantic items. */
227 sem_item *> &m_symtab_node_map);
228
229 /* Return base tree that can be used for compatible_types_p and
230 contains_polymorphic_type_p comparison. */
231 static bool get_base_types (tree *t1, tree *t2);
232
233 /* Return true if target supports alias symbols. */
235
236 /* Item type. */
238
239 /* Symtab node. */
241
242 /* Declaration tree node. */
244
245 /* Number of references to a semantic symbols (function calls,
246 variable references). */
248
249 /* Pointer to a congruence class the item belongs to. */
251
252 /* Index of the item in a class belonging to. */
253 unsigned int index_in_class;
254
255 /* A bitmap with indices of all classes referencing this item. */
257
258 /* List of tree references (either FUNC_DECL or VAR_DECL). */
259 vec <tree> tree_refs;
260
261 /* A set with symbol table references. */
262 hash_set <symtab_node *> refs_set;
263
264 /* Temporary hash used where hash values of references are added. */
265 hashval_t global_hash;
266
267 /* Number of references to this symbol. */
269protected:
270 /* Cached, once calculated hash for the item. */
271
272 /* Compare properties of symbol that does not affect semantics of symbol
273 itself but affects semantics of its references.
274 If ADDRESS is true, do extra checking needed for IPA_REF_ADDR. */
276 symtab_node *n1,
277 symtab_node *n2,
278 bool address);
279
280 /* Hash properties compared by compare_referenced_symbol_properties. */
282 inchash::hash &hstate,
283 bool address);
284
285 /* For a given symbol table nodes N1 and N2, we check that FUNCTION_DECLs
286 point to a same function. Comparison can be skipped if IGNORED_NODES
287 contains these nodes. ADDRESS indicate if address is taken. */
288 bool compare_symbol_references (hash_map <symtab_node *, sem_item *>
289 &ignored_nodes,
290 symtab_node *n1, symtab_node *n2,
291 bool address);
292protected:
293 /* Hash of item. */
294 hashval_t m_hash;
295
296 /* Indicated whether a hash value has been set or not. */
298
299private:
300 /* Initialize internal data structures. Bitmap STACK is used for
301 bitmap memory allocation process. */
302 void setup (bitmap_obstack *stack);
303
304 /* Because types can be arbitrarily large, avoid quadratic bottleneck. */
306}; // class sem_item
307
309{
310public:
311 /* Semantic function constructor that uses STACK as bitmap memory stack. */
313
314 /* Constructor based on callgraph node _NODE.
315 Bitmap STACK is used for memory allocation. */
316 sem_function (cgraph_node *_node, bitmap_obstack *stack);
317
318 ~sem_function ();
319
320 void init (ipa_icf_gimple::func_checker *) final override;
321 bool equals_wpa (sem_item *item,
322 hash_map <symtab_node *, sem_item *> &ignored_nodes)
323 final override;
324 hashval_t get_hash (void) final override;
325 bool equals (sem_item *item,
326 hash_map <symtab_node *, sem_item *> &ignored_nodes)
327 final override;
328 bool merge (sem_item *alias_item) final override;
329
330 /* Dump symbol to FILE. */
331 void dump_to_file (FILE *file) final override
332 {
333 gcc_assert (file);
335 }
336
337 /* Returns cgraph_node. */
338 inline cgraph_node *get_node (void)
339 {
341 }
342
343 /* Improve accumulated hash for HSTATE based on a gimple statement STMT. */
344 void hash_stmt (gimple *stmt, inchash::hash &inchash);
345
346 /* Return true if polymorphic comparison must be processed. */
347 bool compare_polymorphic_p (void);
348
349 /* For a given call graph NODE, the function constructs new
350 semantic function item. */
353
354 /* Perform additional checks needed to match types of used function
355 parameters. */
357
358 /* Exception handling region tree. */
360
361 /* Number of function arguments. */
362 unsigned int arg_count;
363
364 /* Total amount of edges in the function. */
365 unsigned int edge_count;
366
367 /* Vector of sizes of all basic blocks. */
368 vec <unsigned int> bb_sizes;
369
370 /* Control flow graph checksum. */
371 hashval_t cfg_checksum;
372
373 /* GIMPLE codes hash value. */
374 hashval_t gcode_hash;
375
376 /* Vector of subpart of memory access types. */
378
379 /* Total number of SSA names used in the function. */
381
382 /* Array of structures for all basic blocks. */
383 vec <ipa_icf_gimple::sem_bb *> bb_sorted;
384
385 /* Hash of canonical types used for memory references in the
386 function. */
388
389 /* Return true if parameter I may be used. */
390 bool param_used_p (unsigned int i);
391
392private:
393 /* Calculates hash value based on a BASIC_BLOCK. */
395
396 /* For given basic blocks BB1 and BB2 (from functions FUNC1 and FUNC),
397 true value is returned if phi nodes are semantically
398 equivalent in these blocks . */
400
401 /* Basic blocks dictionary BB_DICT returns true if SOURCE index BB
402 corresponds to TARGET. */
403 bool bb_dict_test (vec<int> *bb_dict, int source, int target);
404
405 /* If cgraph edges E1 and E2 are indirect calls, verify that
406 ICF flags are the same. */
408
409 /* Processes function equality comparison. */
410 bool equals_private (sem_item *item);
411
412 /* Function checker stores binding between functions. */
414
415 /* COMPARED_FUNC is a function that we compare to. */
417}; // class sem_function
418
420{
421public:
422 /* Semantic variable constructor that uses STACK as bitmap memory stack. */
424
425 /* Constructor based on callgraph node _NODE.
426 Bitmap STACK is used for memory allocation. */
427
429
430 /* Semantic variable initialization function. */
431 void init (ipa_icf_gimple::func_checker *) final override;
432
433 hashval_t get_hash (void) final override;
434 bool merge (sem_item *alias_item) final override;
435 void dump_to_file (FILE *file) final override;
436 bool equals (sem_item *item,
437 hash_map <symtab_node *, sem_item *> &ignored_nodes)
438 final override;
439
440 /* Fast equality variable based on knowledge known in WPA. */
441 bool equals_wpa (sem_item *item,
442 hash_map <symtab_node *, sem_item *> &ignored_nodes)
443 final override;
444
445 /* Returns varpool_node. */
446 inline varpool_node *get_node (void)
447 {
449 }
450
451 /* Parser function that visits a varpool NODE. */
454
455private:
456 /* Compares trees T1 and T2 for semantic equality. */
457 static bool equals (tree t1, tree t2);
458}; // class sem_variable
459
460class sem_item_optimizer;
461
463{
464 hashval_t hash;
466 vec <congruence_class *> classes;
467};
468
469/* Congruence class set structure. */
470struct congruence_class_hash : nofree_ptr_hash <congruence_class_group>
471{
472 static inline hashval_t hash (const congruence_class_group *item)
473 {
474 return item->hash;
475 }
476
477 static inline int equal (const congruence_class_group *item1,
478 const congruence_class_group *item2)
479 {
480 return item1->hash == item2->hash && item1->type == item2->type;
481 }
482};
483
489
490/* Semantic item optimizer includes all top-level logic
491 related to semantic equality comparison. */
493{
494public:
497
498 /* Function responsible for visiting all potential functions and
499 read-only variables that can be merged. */
500 void parse_funcs_and_vars (void);
501
502 /* Optimizer entry point which returns true in case it processes
503 a merge operation. True is returned if there's a merge operation
504 processed. */
505 bool execute (void);
506
507 /* Dump function. */
508 void dump (void);
509
510 /* Verify congruence classes if checking is enabled. */
511 void checking_verify_classes (void);
512
513 /* Verify congruence classes. */
514 void verify_classes (void);
515
516 /* Write IPA ICF summary for symbols. */
517 void write_summary (void);
518
519 /* Read IPA ICF summary for symbols. */
520 void read_summary (void);
521
522 /* Callgraph removal hook called for a NODE with a custom DATA. */
523 static void cgraph_removal_hook (cgraph_node *node, void *data);
524
525 /* Varpool removal hook called for a NODE with a custom DATA. */
526 static void varpool_removal_hook (varpool_node *node, void *data);
527
528 /* Worklist of congruence classes that can potentially
529 refine classes of congruence. */
531
532 /* Remove semantic ITEM and release memory. */
533 void remove_item (sem_item *item);
534
535 /* Remove symtab NODE triggered by symtab removal hooks. */
536 void remove_symtab_node (symtab_node *node);
537
538 /* Register callgraph and varpool hooks. */
539 void register_hooks (void);
540
541 /* Unregister callgraph and varpool hooks. */
542 void unregister_hooks (void);
543
544 /* Adds a CLS to hashtable associated by hash value. */
545 void add_class (congruence_class *cls);
546
547 /* Gets a congruence class group based on given HASH value and TYPE. */
550private:
551
552 /* For each semantic item, append hash values of references. */
554
555 /* Update hash by canonical types of memory accesses. */
557
558 /* Congruence classes are built by hash value. */
559 void build_hash_based_classes (void);
560
561 /* Semantic items in classes having more than one element and initialized.
562 In case of WPA, we load function body. */
563 unsigned int parse_nonsingleton_classes (void);
564
565 /* Equality function for semantic items is used to subdivide existing
566 classes. If IN_WPA, fast equality function is invoked. */
567 void subdivide_classes_by_equality (bool in_wpa = false);
568
569 /* Subdivide classes by address and interposable references
570 that members of the class reference.
571 Example can be a pair of functions that have an address
572 taken from a function. If these addresses are different the class
573 is split. */
575
576 /* Debug function prints all informations about congruence classes. */
577 void dump_cong_classes (void);
578
579 /* Build references according to call graph. */
580 void build_graph (void);
581
582 /* Iterative congruence reduction function. */
583 void process_cong_reduction (void);
584
585 /* After reduction is done, we can declare all items in a group
586 to be equal. PREV_CLASS_COUNT is start number of classes
587 before reduction. True is returned if there's a merge operation
588 processed. LOADED_SYMBOLS is number of symbols that were loaded
589 in WPA. */
590 bool merge_classes (unsigned int prev_class_count,
591 unsigned int loaded_symbols);
592
593 /* Fixup points to analysis info. */
594 void fixup_points_to_sets (void);
595
596 /* Fixup points to set PT. */
597 void fixup_pt_set (struct pt_solution *pt);
598
599 /* Adds a newly created congruence class CLS to worklist. */
601
602 /* Pops a class from worklist. */
604
605 /* Every usage of a congruence class CLS is a candidate that can split the
606 collection of classes. Bitmap stack BMSTACK is used for bitmap
607 allocation. */
609
610 /* Tests if a class CLS used as INDEXth splits any congruence classes.
611 Bitmap stack BMSTACK is used for bitmap allocation. */
612 bool do_congruence_step_for_index (congruence_class *cls, unsigned int index);
613
614 /* Makes pairing between a congruence class CLS and semantic ITEM. */
615 static void add_item_to_class (congruence_class *cls, sem_item *item);
616
617 /* Disposes split map traverse function. CLS is congruence
618 class, BSLOT is bitmap slot we want to release. DATA is mandatory,
619 but unused argument. */
620 static bool release_split_map (congruence_class * const &cls, bitmap const &b,
622
623 /* Process split operation for a congruence class CLS,
624 where bitmap B splits congruence class members. DATA is used
625 as argument of split pair. */
626 static bool traverse_congruence_split (congruence_class * const &cls,
627 bitmap const &b,
629
630 /* Compare function for sorting pairs in do_congruence_step_f. */
631 static int sort_congruence_split (const void *, const void *);
632
633 /* Reads a section from LTO stream file FILE_DATA. Input block for DATA
634 contains LEN bytes. */
635 void read_section (lto_file_decl_data *file_data, const char *data,
636 size_t len);
637
638 /* Removes all callgraph and varpool nodes that are marked by symtab
639 as deleted. */
640 void filter_removed_items (void);
641
642 /* Vector of semantic items. */
643 vec <sem_item *> m_items;
644
645 /* A set containing all items removed by hooks. */
646 hash_set <symtab_node *> m_removed_items_set;
647
648 /* Hashtable of congruence classes. */
649 hash_table <congruence_class_hash> m_classes;
650
651 /* Count of congruence classes. */
652 unsigned int m_classes_count;
653
654 /* Map data structure maps symtab nodes to semantic items. */
655 hash_map <symtab_node *, sem_item *> m_symtab_node_map;
656
657 /* Set to true if a splitter class is removed. */
659
660 /* Global unique class id counter. */
661 static unsigned int class_id;
662
663 /* Callgraph node removal hook holder. */
665
666 /* Varpool node removal hook holder. */
668
669 /* Bitmap stack. */
671
672 /* Vector of merged variables. Needed for fixup of points-to-analysis
673 info. */
674 vec <symtab_pair> m_merged_variables;
675
676 /* Hash map will all references. */
678}; // class sem_item_optimizer
679
680} // ipa_icf namespace
Definition vec.h:1656
Definition cgraph.h:1696
Definition genoutput.cc:147
Definition fibonacci_heap.h:143
Definition hash-map.h:40
Definition inchash.h:38
void add_int(unsigned v)
Definition inchash.h:55
hashval_t end()
Definition inchash.h:49
void add_ptr(const void *ptr)
Definition inchash.h:94
Definition ipa-icf.h:29
auto_vec< sem_item * > members
Definition ipa-icf.h:54
congruence_class(unsigned int _id)
Definition ipa-icf.h:32
bool is_class_used(void)
Definition ipa-icf.cc:3611
unsigned referenced_by_count
Definition ipa-icf.h:60
void dump(FILE *file, unsigned int indent=0) const
Definition ipa-icf.cc:3596
~congruence_class()
Definition ipa-icf.h:38
bool in_worklist
Definition ipa-icf.h:51
unsigned int id
Definition ipa-icf.h:57
Definition ipa-icf.h:309
static sem_function * parse(cgraph_node *node, bitmap_obstack *stack, ipa_icf_gimple::func_checker *checker)
Definition ipa-icf.cc:1531
bool equals(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes) final override
Definition ipa-icf.cc:812
ipa_icf_gimple::func_checker * m_checker
Definition ipa-icf.h:413
void dump_to_file(FILE *file) final override
Definition ipa-icf.h:331
eh_region region_tree
Definition ipa-icf.h:359
sem_function * m_compared_func
Definition ipa-icf.h:416
bool compare_phi_node(basic_block bb1, basic_block bb2)
Definition ipa-icf.cc:1562
bool merge(sem_item *alias_item) final override
Definition ipa-icf.cc:1017
bool equals_wpa(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes) final override
Definition ipa-icf.cc:537
vec< unsigned int > bb_sizes
Definition ipa-icf.h:368
auto_vec< tree > memory_access_types
Definition ipa-icf.h:377
bool param_used_p(unsigned int i)
Definition ipa-icf.cc:497
hashval_t cfg_checksum
Definition ipa-icf.h:371
unsigned int edge_count
Definition ipa-icf.h:365
vec< ipa_icf_gimple::sem_bb * > bb_sorted
Definition ipa-icf.h:383
void init(ipa_icf_gimple::func_checker *) final override
Definition ipa-icf.cc:1350
bool compare_polymorphic_p(void)
Definition ipa-icf.cc:1510
bool compatible_parm_types_p(tree, tree)
Definition ipa-icf.cc:515
hashval_t gcode_hash
Definition ipa-icf.h:374
unsigned ssa_names_size
Definition ipa-icf.h:380
sem_function(bitmap_obstack *stack)
Definition ipa-icf.cc:238
hashval_t m_alias_sets_hash
Definition ipa-icf.h:387
hashval_t get_hash(void) final override
Definition ipa-icf.cc:279
~sem_function()
Definition ipa-icf.cc:254
bool compare_edge_flags(cgraph_edge *e1, cgraph_edge *e2)
Definition ipa-icf.cc:478
cgraph_node * get_node(void)
Definition ipa-icf.h:338
void hash_stmt(gimple *stmt, inchash::hash &inchash)
Definition ipa-icf.cc:1444
bool bb_dict_test(vec< int > *bb_dict, int source, int target)
Definition ipa-icf.cc:1626
unsigned int arg_count
Definition ipa-icf.h:362
bool equals_private(sem_item *item)
Definition ipa-icf.cc:837
hashval_t get_bb_hash(const ipa_icf_gimple::sem_bb *basic_block)
Definition ipa-icf.cc:266
Definition ipa-icf.h:493
void fixup_points_to_sets(void)
Definition ipa-icf.cc:3549
static int sort_congruence_split(const void *, const void *)
Definition ipa-icf.cc:3054
hash_table< congruence_class_hash > m_classes
Definition ipa-icf.h:649
hash_map< symtab_node *, sem_item * > m_symtab_node_map
Definition ipa-icf.h:655
void dump_cong_classes(void)
Definition ipa-icf.cc:3239
void update_hash_by_addr_refs()
Definition ipa-icf.cc:2562
void update_hash_by_memory_access_type()
Definition ipa-icf.cc:2620
unsigned subdivide_classes_by_sensitive_refs()
Definition ipa-icf.cc:2816
void checking_verify_classes(void)
Definition ipa-icf.cc:2905
void build_graph(void)
Definition ipa-icf.cc:2659
bool execute(void)
Definition ipa-icf.cc:2461
static bool release_split_map(congruence_class *const &cls, bitmap const &b, traverse_split_pair *pair)
Definition ipa-icf.cc:2942
void remove_item(sem_item *item)
Definition ipa-icf.cc:2398
bool splitter_class_removed
Definition ipa-icf.h:658
void build_hash_based_classes(void)
Definition ipa-icf.cc:2637
bool merge_classes(unsigned int prev_class_count, unsigned int loaded_symbols)
Definition ipa-icf.cc:3339
void do_congruence_step(congruence_class *cls)
Definition ipa-icf.cc:3137
void read_section(lto_file_decl_data *file_data, const char *data, size_t len)
Definition ipa-icf.cc:2220
hash_set< symtab_node * > m_removed_items_set
Definition ipa-icf.h:646
varpool_node_hook_list * m_varpool_node_hooks
Definition ipa-icf.h:667
fibonacci_heap< unsigned, congruence_class > worklist
Definition ipa-icf.h:530
void subdivide_classes_by_equality(bool in_wpa=false)
Definition ipa-icf.cc:2733
static void varpool_removal_hook(varpool_node *node, void *data)
Definition ipa-icf.cc:2381
static void add_item_to_class(congruence_class *cls, sem_item *item)
Definition ipa-icf.cc:2551
void write_summary(void)
Definition ipa-icf.cc:2164
unsigned int m_classes_count
Definition ipa-icf.h:652
congruence_class * worklist_pop()
Definition ipa-icf.cc:3178
void process_cong_reduction(void)
Definition ipa-icf.cc:3206
void read_summary(void)
Definition ipa-icf.cc:2292
void verify_classes(void)
Definition ipa-icf.cc:2914
unsigned int parse_nonsingleton_classes(void)
Definition ipa-icf.cc:2706
void filter_removed_items(void)
Definition ipa-icf.cc:2409
void fixup_pt_set(struct pt_solution *pt)
Definition ipa-icf.cc:3517
bool do_congruence_step_for_index(congruence_class *cls, unsigned int index)
Definition ipa-icf.cc:3071
vec< symtab_pair > m_merged_variables
Definition ipa-icf.h:674
ref_map m_references
Definition ipa-icf.h:677
void add_class(congruence_class *cls)
Definition ipa-icf.cc:2337
congruence_class_group * get_group_by_hash(hashval_t hash, sem_item_type type)
Definition ipa-icf.cc:2350
void parse_funcs_and_vars(void)
Definition ipa-icf.cc:2515
void worklist_push(congruence_class *cls)
Definition ipa-icf.cc:3165
static unsigned int class_id
Definition ipa-icf.h:661
void remove_symtab_node(symtab_node *node)
Definition ipa-icf.cc:2390
cgraph_node_hook_list * m_cgraph_node_hooks
Definition ipa-icf.h:664
vec< sem_item * > m_items
Definition ipa-icf.h:643
~sem_item_optimizer()
Definition ipa-icf.cc:2139
static void cgraph_removal_hook(cgraph_node *node, void *data)
Definition ipa-icf.cc:2372
void register_hooks(void)
Definition ipa-icf.cc:2311
static bool traverse_congruence_split(congruence_class *const &cls, bitmap const &b, traverse_split_pair *pair)
Definition ipa-icf.cc:2957
sem_item_optimizer()
Definition ipa-icf.cc:2131
bitmap_obstack m_bmstack
Definition ipa-icf.h:670
void unregister_hooks(void)
Definition ipa-icf.cc:2325
Definition ipa-icf.h:178
virtual bool equals(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes)=0
static bool get_base_types(tree *t1, tree *t2)
congruence_class * cls
Definition ipa-icf.h:250
virtual bool equals_wpa(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes)=0
bool m_hash_set
Definition ipa-icf.h:297
unsigned referenced_by_count
Definition ipa-icf.h:268
virtual void init(ipa_icf_gimple::func_checker *)=0
virtual void dump_to_file(FILE *file)=0
hash_set< symtab_node * > refs_set
Definition ipa-icf.h:262
hashval_t m_hash
Definition ipa-icf.h:294
sem_item(sem_item_type _type, bitmap_obstack *stack)
Definition ipa-icf.cc:147
void hash_referenced_symbol_properties(symtab_node *ref, inchash::hash &hstate, bool address)
Definition ipa-icf.cc:416
unsigned int index_in_class
Definition ipa-icf.h:253
static bool compare_referenced_symbol_properties(symtab_node *used_by, symtab_node *n1, symtab_node *n2, bool address)
Definition ipa-icf.cc:326
void setup(bitmap_obstack *stack)
Definition ipa-icf.cc:186
bool compare_symbol_references(hash_map< symtab_node *, sem_item * > &ignored_nodes, symtab_node *n1, symtab_node *n2, bool address)
Definition ipa-icf.cc:445
symtab_node * node
Definition ipa-icf.h:240
tree decl
Definition ipa-icf.h:243
virtual hashval_t get_hash(void)=0
bitmap usage_index_bitmap
Definition ipa-icf.h:256
vec< tree > tree_refs
Definition ipa-icf.h:259
void update_hash_by_addr_refs(hash_map< symtab_node *, sem_item * > &m_symtab_node_map)
Definition ipa-icf.cc:747
virtual bool merge(sem_item *alias_item)=0
hashval_t global_hash
Definition ipa-icf.h:265
virtual ~sem_item()
Definition ipa-icf.cc:195
unsigned reference_count
Definition ipa-icf.h:247
static hash_map< const_tree, hashval_t > m_type_hash_cache
Definition ipa-icf.h:305
void update_hash_by_local_refs(hash_map< symtab_node *, sem_item * > &m_symtab_node_map)
Definition ipa-icf.cc:782
DEBUG_FUNCTION void dump(void)
Definition ipa-icf.cc:205
sem_item_type type
Definition ipa-icf.h:237
bool target_supports_symbol_aliases_p(void)
Definition ipa-icf.cc:218
void set_hash(hashval_t hash)
Definition ipa-icf.cc:228
void add_reference(ref_map *map, sem_item *target)
Definition ipa-icf.cc:165
Definition ipa-icf.h:135
sem_usage_pair(sem_item *_item, unsigned int _index)
Definition ipa-icf.cc:142
sem_item * item
Definition ipa-icf.h:141
unsigned int index
Definition ipa-icf.h:144
Definition ipa-icf.h:420
static sem_variable * parse(varpool_node *node, bitmap_obstack *stack, ipa_icf_gimple::func_checker *checker)
Definition ipa-icf.cc:1928
void init(ipa_icf_gimple::func_checker *) final override
Definition ipa-icf.cc:1944
bool equals(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes) final override
Definition ipa-icf.cc:1714
bool merge(sem_item *alias_item) final override
Definition ipa-icf.cc:1974
varpool_node * get_node(void)
Definition ipa-icf.h:446
void dump_to_file(FILE *file) final override
Definition ipa-icf.cc:2121
sem_variable(bitmap_obstack *stack)
Definition ipa-icf.cc:1643
hashval_t get_hash(void) final override
Definition ipa-icf.cc:1964
bool equals_wpa(sem_item *item, hash_map< symtab_node *, sem_item * > &ignored_nodes) final override
Definition ipa-icf.cc:1657
Definition ipa-icf.h:73
vec< symtab_node * > m_interposables
Definition ipa-icf.h:89
vec< symtab_node * > m_references
Definition ipa-icf.h:86
symbol_compare_collection(symtab_node *node)
Definition ipa-icf.cc:106
~symbol_compare_collection()
Definition ipa-icf.h:79
Definition ipa-icf-gimple.h:122
Definition ipa-icf-gimple.h:104
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
static struct string2counter_map map[debug_counter_number_of_counters]
Definition dbgcnt.cc:39
@ TDF_DETAILS
Definition dumpfile.h:92
T dyn_cast(U *p)
Definition is-a.h:280
Definition fold-const.cc:4240
Definition ipa-icf.cc:97
std::pair< symtab_node *, symtab_node * > symtab_pair
Definition ipa-icf.h:173
hash_map< sem_usage_hash, auto_vec< sem_item * > > ref_map
Definition ipa-icf.h:171
sem_item_type
Definition ipa-icf.h:65
@ FUNC
Definition ipa-icf.h:66
@ VAR
Definition ipa-icf.h:67
i
Definition poly-int.h:772
Ca const poly_int< N, Cb > & b
Definition poly-int.h:767
Ca & a
Definition poly-int.h:766
Definition basic-block.h:117
Definition bitmap.h:294
Definition cgraph.cc:91
Definition cgraph.h:875
Definition genautomata.cc:499
Definition except.h:119
Definition gimple.h:225
Definition collect2.cc:168
Definition ipa-icf.h:463
sem_item_type type
Definition ipa-icf.h:465
hashval_t hash
Definition ipa-icf.h:464
vec< congruence_class * > classes
Definition ipa-icf.h:466
Definition ipa-icf.h:471
static int equal(const congruence_class_group *item1, const congruence_class_group *item2)
Definition ipa-icf.h:477
static hashval_t hash(const congruence_class_group *item)
Definition ipa-icf.h:472
Definition ipa-icf.h:170
Definition ipa-icf.h:148
static bool equal(sem_usage_pair *, sem_usage_pair *)
Definition ipa-icf.h:165
static hashval_t hash(sem_usage_pair *)
Definition ipa-icf.h:154
Definition ipa-icf.h:95
static hashval_t hash(value_type v)
Definition ipa-icf.h:97
static bool equal(value_type a, value_type b)
Definition ipa-icf.h:114
Definition ipa-icf.h:485
sem_item_optimizer * optimizer
Definition ipa-icf.h:486
class congruence_class * cls
Definition ipa-icf.h:487
Definition lto-streamer.h:557
Definition hash-traits.h:303
Definition gengtype.h:218
Definition hash-traits.h:168
symbol_compare_collection * value_type
Definition hash-traits.h:169
Definition tree-ssa-alias.h:29
Definition cgraph.h:106
Definition gengtype.h:252
Definition hash-traits.h:57
Definition varpool.cc:45
Definition cgraph.h:2000
Definition vec.h:450
#define gcc_assert(EXPR)
Definition system.h:821
#define false
Definition system.h:895
#define DEBUG_FUNCTION
Definition system.h:1242
void dump_function_to_file(tree fndecl, FILE *file, dump_flags_t flags)
Definition tree-cfg.cc:8279