GCC Middle and Back End API Reference
symbol-summary.h
Go to the documentation of this file.
1/* Callgraph summary data structure.
2 Copyright (C) 2014-2024 Free Software Foundation, Inc.
3 Contributed by Martin Liska
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_SYMBOL_SUMMARY_H
22#define GCC_SYMBOL_SUMMARY_H
23
24/* Base class for function_summary and fast_function_summary classes. */
25
26template <class T>
28{
29public:
30 /* Default construction takes SYMTAB as an argument. */
47
48 /* Basic implementation of insert operation. */
49 virtual void insert (cgraph_node *, T *)
50 {
51 /* In most cases, it makes no sense to create summaries without
52 initializing them. */
54 }
55
56 /* Basic implementation of removal operation. */
57 virtual void remove (cgraph_node *, T *) {}
58
59 /* Basic implementation of duplication operation. */
60 virtual void duplicate (cgraph_node *, cgraph_node *, T *, T *)
61 {
62 /* It makes no sense to not copy anything during duplication. */
64 }
65
66 /* Enable insertion hook invocation. */
73
74 /* Disable insertion hook invocation. */
83
84 /* Enable duplication hook invocation. */
91
92 /* Enable duplication hook invocation. */
101
102protected:
103 /* Allocates new data that are stored within map. */
105 {
106 /* Call gcc_internal_because we do not want to call finalizer for
107 a type T. We call dtor explicitly. */
108 return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T ()
109 : m_allocator.allocate () ;
110 }
111
112 /* Release an item that is stored within map. */
113 void release (T *item)
114 {
115 if (is_ggc ())
116 ggc_delete (item);
117 else
118 m_allocator.remove (item);
119 }
120
121 /* Unregister all call-graph hooks. */
122 void unregister_hooks ();
123
124 /* Symbol table the summary is registered to. */
126
127 /* Insertion function defined by a summary. */
129 /* Removal function defined by a summary. */
131 /* Duplication function defined by a summary. */
133
134 /* Internal summary insertion hook pointer. */
136 /* Internal summary removal hook pointer. */
138 /* Internal summary duplication hook pointer. */
140
141private:
142 /* Return true when the summary uses GGC memory for allocation. */
143 virtual bool is_ggc () = 0;
144
145 /* Object allocator for heap allocation. */
147};
148
149template <typename T>
150void
152{
153 disable_insertion_hook ();
154 m_symtab->remove_cgraph_removal_hook (m_symtab_removal_hook);
155 disable_duplication_hook ();
156}
157
158/* We want to pass just pointer types as argument for function_summary
159 template class. */
160
161template <class T>
163{
164private:
166};
167
168/* Function summary is a helper class that is used to associate a data structure
169 related to a callgraph node. Typical usage can be seen in IPA passes which
170 create a temporary pass-related structures. The summary class registers
171 hooks that are triggered when a new node is inserted, duplicated and deleted.
172 A user of a summary class can ovewrite virtual methods than are triggered by
173 the summary if such hook is triggered. Apart from a callgraph node, the user
174 is given a data structure tied to the node.
175
176 The function summary class can work both with a heap-allocated memory and
177 a memory gained by garbage collected memory. */
178
179template <class T>
181{
182public:
183 /* Default construction takes SYMTAB as an argument. */
185
186 /* Destructor. */
187 virtual ~function_summary ();
188
189 /* Traverses all summarys with a function F called with
190 ARG as argument. */
191 template<typename Arg, bool (*f)(const T &, Arg)>
192 void traverse (Arg a) const
193 {
194 m_map.template traverse <f> (a);
195 }
196
197 /* Getter for summary callgraph node pointer. If a summary for a node
198 does not exist it will be created. */
200 {
201 bool existed;
202 T **v = &m_map.get_or_insert (node->get_uid (), &existed);
203 if (!existed)
204 *v = this->allocate_new ();
205
206 return *v;
207 }
208
209 /* Getter for summary callgraph node pointer. */
210 T* get (cgraph_node *node) ATTRIBUTE_PURE
211 {
212 T **v = m_map.get (node->get_uid ());
213 return v == NULL ? NULL : *v;
214 }
215
216 /* Remove node from summary. */
217 using function_summary_base<T>::remove;
218 void remove (cgraph_node *node)
219 {
220 int uid = node->get_uid ();
221 T **v = m_map.get (uid);
222 if (v)
223 {
224 m_map.remove (uid);
225 this->release (*v);
226 }
227 }
228
229 /* Return true if a summary for the given NODE already exists. */
230 bool exists (cgraph_node *node)
231 {
232 return m_map.get (node->get_uid ()) != NULL;
233 }
234
235 /* Symbol insertion hook that is registered to symbol table. */
236 static void symtab_insertion (cgraph_node *node, void *data);
237
238 /* Symbol removal hook that is registered to symbol table. */
239 static void symtab_removal (cgraph_node *node, void *data);
240
241 /* Symbol duplication hook that is registered to symbol table. */
242 static void symtab_duplication (cgraph_node *node, cgraph_node *node2,
243 void *data);
244
245protected:
246 /* Indication if we use ggc summary. */
247 bool m_ggc;
248
249private:
250 /* Indication if we use ggc summary. */
251 bool is_ggc () final override
252 {
253 return m_ggc;
254 }
255
256 typedef int_hash <int, 0, -1> map_hash;
257
258 /* Main summary store, where summary ID is used as key. */
259 hash_map <map_hash, T *> m_map;
260
261 template <typename U> friend void gt_ggc_mx (function_summary <U *> * const &);
262 template <typename U> friend void gt_pch_nx (function_summary <U *> * const &);
263 template <typename U> friend void gt_pch_nx (function_summary <U *> * const &,
264 gt_pointer_operator, void *);
265};
266
267template <typename T>
270 function_summary_base<T> (symtab, function_summary::symtab_insertion,
271 function_summary::symtab_removal,
272 function_summary::symtab_duplication
274 m_ggc (ggc), m_map (13, ggc, true, GATHER_STATISTICS PASS_MEM_STAT) {}
275
276template <typename T>
278{
279 this->unregister_hooks ();
280
281 /* Release all summaries. */
282 typedef typename hash_map <map_hash, T *>::iterator map_iterator;
283 for (map_iterator it = m_map.begin (); it != m_map.end (); ++it)
284 this->release ((*it).second);
285}
286
287template <typename T>
288void
290{
291 gcc_checking_assert (node->get_uid ());
292 function_summary *summary = (function_summary <T *> *) (data);
293 summary->insert (node, summary->get_create (node));
294}
295
296template <typename T>
297void
299{
300 gcc_checking_assert (node->get_uid ());
301 function_summary *summary = (function_summary <T *> *) (data);
302 summary->remove (node);
303}
304
305template <typename T>
306void
308 cgraph_node *node2, void *data)
309{
310 function_summary *summary = (function_summary <T *> *) (data);
311 T *v = summary->get (node);
312
313 if (v)
314 summary->duplicate (node, node2, v, summary->get_create (node2));
315}
316
317template <typename T>
318void
320{
321 gcc_checking_assert (summary->m_ggc);
322 gt_ggc_mx (&summary->m_map);
323}
324
325template <typename T>
326void
331
332template <typename T>
333void
338
339/* Help template from std c++11. */
340
341template<typename T, typename U>
343{
344 static const bool value = false;
345};
346
347template<typename T>
348struct is_same<T,T> //specialization
349{
350 static const bool value = true;
351};
352
353/* We want to pass just pointer types as argument for fast_function_summary
354 template class. */
355
356template <class T, class V>
358{
359private:
361};
362
363/* Function vector summary is a fast implementation of function_summary that
364 utilizes vector as primary storage of summaries. */
365
366template <class T, class V>
367class GTY((user)) fast_function_summary <T *, V>
369{
370public:
371 /* Default construction takes SYMTAB as an argument. */
373
374 /* Destructor. */
375 virtual ~fast_function_summary ();
376
377 /* Traverses all summarys with a function F called with
378 ARG as argument. */
379 template<typename Arg, bool (*f)(const T &, Arg)>
380 void traverse (Arg a) const
381 {
382 for (unsigned i = 0; i < m_vector->length (); i++)
383 if ((*m_vector[i]) != NULL)
384 f ((*m_vector)[i], a);
385 }
386
387 /* Getter for summary callgraph node pointer. If a summary for a node
388 does not exist it will be created. */
390 {
391 int id = node->get_summary_id ();
392 if (id == -1)
393 id = this->m_symtab->assign_summary_id (node);
394
395 if ((unsigned int)id >= m_vector->length ())
396 vec_safe_grow_cleared (m_vector,
397 this->m_symtab->cgraph_max_summary_id);
398
399 if ((*m_vector)[id] == NULL)
400 (*m_vector)[id] = this->allocate_new ();
401
402 return (*m_vector)[id];
403 }
404
405 /* Getter for summary callgraph node pointer. */
406 T* get (cgraph_node *node) ATTRIBUTE_PURE
407 {
408 return exists (node) ? (*m_vector)[node->get_summary_id ()] : NULL;
409 }
410
411 using function_summary_base<T>::remove;
412 void remove (cgraph_node *node)
413 {
414 if (exists (node))
415 {
416 int id = node->get_summary_id ();
417 this->release ((*m_vector)[id]);
418 (*m_vector)[id] = NULL;
419 }
420 }
421
422 /* Return true if a summary for the given NODE already exists. */
423 bool exists (cgraph_node *node)
424 {
425 int id = node->get_summary_id ();
426 return (id != -1
427 && (unsigned int)id < m_vector->length ()
428 && (*m_vector)[id] != NULL);
429 }
430
431 /* Symbol insertion hook that is registered to symbol table. */
432 static void symtab_insertion (cgraph_node *node, void *data);
433
434 /* Symbol removal hook that is registered to symbol table. */
435 static void symtab_removal (cgraph_node *node, void *data);
436
437 /* Symbol duplication hook that is registered to symbol table. */
438 static void symtab_duplication (cgraph_node *node, cgraph_node *node2,
439 void *data);
440
441private:
442 bool is_ggc () final override;
443
444 /* Summary is stored in the vector. */
445 vec <T *, V> *m_vector;
446
447 template <typename U> friend void gt_ggc_mx (fast_function_summary <U *, va_gc> * const &);
448 template <typename U> friend void gt_pch_nx (fast_function_summary <U *, va_gc> * const &);
449 template <typename U> friend void gt_pch_nx (fast_function_summary <U *, va_gc> * const &,
450 gt_pointer_operator, void *);
451};
452
453template <typename T, typename V>
457 fast_function_summary::symtab_insertion,
458 fast_function_summary::symtab_removal,
459 fast_function_summary::symtab_duplication
460 PASS_MEM_STAT), m_vector (NULL)
461{
462 vec_alloc (m_vector, 13 PASS_MEM_STAT);
463}
464
465template <typename T, typename V>
467{
468 this->unregister_hooks ();
469
470 /* Release all summaries. */
471 for (unsigned i = 0; i < m_vector->length (); i++)
472 if ((*m_vector)[i] != NULL)
473 this->release ((*m_vector)[i]);
474 vec_free (m_vector);
475}
476
477template <typename T, typename V>
478void
480{
481 gcc_checking_assert (node->get_uid ());
482 fast_function_summary *summary = (fast_function_summary <T *, V> *) (data);
483 summary->insert (node, summary->get_create (node));
484}
485
486template <typename T, typename V>
487void
489{
490 gcc_checking_assert (node->get_uid ());
491 fast_function_summary *summary = (fast_function_summary <T *, V> *) (data);
492
493 if (summary->exists (node))
494 summary->remove (node);
495}
496
497template <typename T, typename V>
498void
500 cgraph_node *node2,
501 void *data)
502{
503 fast_function_summary *summary = (fast_function_summary <T *, V> *) (data);
504 T *v = summary->get (node);
505
506 if (v)
507 {
508 T *duplicate = summary->get_create (node2);
509 summary->duplicate (node, node2, v, duplicate);
510 }
511}
512
513template <typename T, typename V>
514inline bool
519
520template <typename T>
521void
525
526template <typename T>
527void
531
532template <typename T>
533void
538
539template <typename T>
540void
542{
543 ggc_test_and_set_mark (summary->m_vector);
544 gt_ggc_mx (summary->m_vector);
545}
546
547template <typename T>
548void
553
554template <typename T>
555void
561
562/* Base class for call_summary and fast_call_summary classes. */
563
564template <class T>
566{
567public:
568 /* Default construction takes SYMTAB as an argument. */
580
581 /* Basic implementation of removal operation. */
582 virtual void remove (cgraph_edge *, T *) {}
583
584 /* Basic implementation of duplication operation. */
585 virtual void duplicate (cgraph_edge *, cgraph_edge *, T *, T *)
586 {
588 }
589
590 /* Enable duplication hook invocation. */
598
599 /* Enable duplication hook invocation. */
608
609protected:
610 /* Allocates new data that are stored within map. */
612 {
613 /* Call gcc_internal_because we do not want to call finalizer for
614 a type T. We call dtor explicitly. */
615 return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T ()
616 : m_allocator.allocate ();
617 }
618
619 /* Release an item that is stored within map. */
620 void release (T *item)
621 {
622 if (is_ggc ())
623 ggc_delete (item);
624 else
625 m_allocator.remove (item);
626 }
627
628 /* Unregister all call-graph hooks. */
629 void unregister_hooks ();
630
631 /* Symbol table the summary is registered to. */
633
634 /* Removal function defined by a summary. */
636 /* Duplication function defined by a summary. */
638
639 /* Internal summary removal hook pointer. */
641 /* Internal summary duplication hook pointer. */
643 /* Initialize summary for an edge that is cloned. */
645
646private:
647 /* Return true when the summary uses GGC memory for allocation. */
648 virtual bool is_ggc () = 0;
649
650 /* Object allocator for heap allocation. */
652};
653
654template <typename T>
655void
657{
658 m_symtab->remove_edge_removal_hook (m_symtab_removal_hook);
659 disable_duplication_hook ();
660}
661
662/* An impossible class templated by non-pointers so, which makes sure that only
663 summaries gathering pointers can be created. */
664
665template <class T>
667{
668private:
670};
671
672/* Class to store auxiliary information about call graph edges. */
673
674template <class T>
675class GTY((user)) call_summary <T *>: public call_summary_base<T>
676{
677public:
678 /* Default construction takes SYMTAB as an argument. */
679 call_summary (symbol_table *symtab, bool ggc = false
681 : call_summary_base<T> (symtab, call_summary::symtab_removal,
682 call_summary::symtab_duplication PASS_MEM_STAT),
683 m_ggc (ggc), m_map (13, ggc, true, GATHER_STATISTICS PASS_MEM_STAT) {}
684
685 /* Destructor. */
686 virtual ~call_summary ();
687
688 /* Traverses all summarys with an edge E called with
689 ARG as argument. */
690 template<typename Arg, bool (*f)(const T &, Arg)>
691 void traverse (Arg a) const
692 {
693 m_map.template traverse <f> (a);
694 }
695
696 /* Getter for summary callgraph edge pointer.
697 If a summary for an edge does not exist, it will be created. */
699 {
700 bool existed;
701 T **v = &m_map.get_or_insert (edge->get_uid (), &existed);
702 if (!existed)
703 *v = this->allocate_new ();
704
705 return *v;
706 }
707
708 /* Getter for summary callgraph edge pointer. */
709 T* get (cgraph_edge *edge) ATTRIBUTE_PURE
710 {
711 T **v = m_map.get (edge->get_uid ());
712 return v == NULL ? NULL : *v;
713 }
714
715 /* Remove edge from summary. */
716 using call_summary_base<T>::remove;
718 {
719 int uid = edge->get_uid ();
720 T **v = m_map.get (uid);
721 if (v)
722 {
723 m_map.remove (uid);
724 this->release (*v);
725 }
726 }
727
728 /* Return true if a summary for the given EDGE already exists. */
730 {
731 return m_map.get (edge->get_uid ()) != NULL;
732 }
733
734 /* Symbol removal hook that is registered to symbol table. */
735 static void symtab_removal (cgraph_edge *edge, void *data);
736
737 /* Symbol duplication hook that is registered to symbol table. */
738 static void symtab_duplication (cgraph_edge *edge1, cgraph_edge *edge2,
739 void *data);
740
741protected:
742 /* Indication if we use ggc summary. */
743 bool m_ggc;
744
745private:
746 /* Indication if we use ggc summary. */
747 bool is_ggc () final override
748 {
749 return m_ggc;
750 }
751
752 typedef int_hash <int, 0, -1> map_hash;
753
754 /* Main summary store, where summary ID is used as key. */
755 hash_map <map_hash, T *> m_map;
756
757 template <typename U> friend void gt_ggc_mx (call_summary <U *> * const &);
758 template <typename U> friend void gt_pch_nx (call_summary <U *> * const &);
759 template <typename U> friend void gt_pch_nx (call_summary <U *> * const &,
760 gt_pointer_operator, void *);
761};
762
763template <typename T>
765{
766 this->unregister_hooks ();
767
768 /* Release all summaries. */
769 typedef typename hash_map <map_hash, T *>::iterator map_iterator;
770 for (map_iterator it = m_map.begin (); it != m_map.end (); ++it)
771 this->release ((*it).second);
772}
773
774template <typename T>
775void
777{
778 call_summary *summary = (call_summary <T *> *) (data);
779 summary->remove (edge);
780}
781
782template <typename T>
783void
785 cgraph_edge *edge2, void *data)
786{
787 call_summary *summary = (call_summary <T *> *) (data);
788 T *edge1_summary = NULL;
789
790 if (summary->m_initialize_when_cloning)
791 edge1_summary = summary->get_create (edge1);
792 else
793 edge1_summary = summary->get (edge1);
794
795 if (edge1_summary)
796 summary->duplicate (edge1, edge2, edge1_summary,
797 summary->get_create (edge2));
798}
799
800template <typename T>
801void
803{
804 gcc_checking_assert (summary->m_ggc);
805 gt_ggc_mx (&summary->m_map);
806}
807
808template <typename T>
809void
811{
813}
814
815template <typename T>
816void
821
822/* We want to pass just pointer types as argument for fast_call_summary
823 template class. */
824
825template <class T, class V>
827{
828private:
830};
831
832/* Call vector summary is a fast implementation of call_summary that
833 utilizes vector as primary storage of summaries. */
834
835template <class T, class V>
836class GTY((user)) fast_call_summary <T *, V>: public call_summary_base<T>
837{
838public:
839 /* Default construction takes SYMTAB as an argument. */
841 : call_summary_base<T> (symtab, fast_call_summary::symtab_removal,
842 fast_call_summary::symtab_duplication PASS_MEM_STAT),
843 m_vector (NULL)
844 {
845 vec_alloc (m_vector, 13 PASS_MEM_STAT);
846 }
847
848 /* Destructor. */
849 virtual ~fast_call_summary ();
850
851 /* Traverses all summarys with an edge F called with
852 ARG as argument. */
853 template<typename Arg, bool (*f)(const T &, Arg)>
854 void traverse (Arg a) const
855 {
856 for (unsigned i = 0; i < m_vector->length (); i++)
857 if ((*m_vector[i]) != NULL)
858 f ((*m_vector)[i], a);
859 }
860
861 /* Getter for summary callgraph edge pointer.
862 If a summary for an edge does not exist, it will be created. */
864 {
865 int id = edge->get_summary_id ();
866 if (id == -1)
867 id = this->m_symtab->assign_summary_id (edge);
868
869 if ((unsigned)id >= m_vector->length ())
870 vec_safe_grow_cleared (m_vector, this->m_symtab->edges_max_summary_id);
871
872 if ((*m_vector)[id] == NULL)
873 (*m_vector)[id] = this->allocate_new ();
874
875 return (*m_vector)[id];
876 }
877
878 /* Getter for summary callgraph edge pointer. */
879 T* get (cgraph_edge *edge) ATTRIBUTE_PURE
880 {
881 return exists (edge) ? (*m_vector)[edge->get_summary_id ()] : NULL;
882 }
883
884 /* Remove edge from summary. */
885 using call_summary_base<T>::remove;
887 {
888 if (exists (edge))
889 {
890 int id = edge->get_summary_id ();
891 this->release ((*m_vector)[id]);
892 (*m_vector)[id] = NULL;
893 }
894 }
895
896 /* Return true if a summary for the given EDGE already exists. */
898 {
899 int id = edge->get_summary_id ();
900 return (id != -1
901 && (unsigned)id < m_vector->length ()
902 && (*m_vector)[id] != NULL);
903 }
904
905 /* Symbol removal hook that is registered to symbol table. */
906 static void symtab_removal (cgraph_edge *edge, void *data);
907
908 /* Symbol duplication hook that is registered to symbol table. */
909 static void symtab_duplication (cgraph_edge *edge1, cgraph_edge *edge2,
910 void *data);
911
912private:
913 bool is_ggc () final override;
914
915 /* Summary is stored in the vector. */
916 vec <T *, V> *m_vector;
917
918 template <typename U> friend void gt_ggc_mx (fast_call_summary <U *, va_gc> * const &);
919 template <typename U> friend void gt_pch_nx (fast_call_summary <U *, va_gc> * const &);
920 template <typename U> friend void gt_pch_nx (fast_call_summary <U *, va_gc> * const &,
921 gt_pointer_operator, void *);
922};
923
924template <typename T, typename V>
926{
927 this->unregister_hooks ();
928
929 /* Release all summaries. */
930 for (unsigned i = 0; i < m_vector->length (); i++)
931 if ((*m_vector)[i] != NULL)
932 this->release ((*m_vector)[i]);
933 vec_free (m_vector);
934}
935
936template <typename T, typename V>
937void
939{
940 fast_call_summary *summary = (fast_call_summary <T *, V> *) (data);
941 summary->remove (edge);
942}
943
944template <typename T, typename V>
945void
947 cgraph_edge *edge2, void *data)
948{
949 fast_call_summary *summary = (fast_call_summary <T *, V> *) (data);
950 T *edge1_summary = NULL;
951
952 if (summary->m_initialize_when_cloning)
953 edge1_summary = summary->get_create (edge1);
954 else
955 edge1_summary = summary->get (edge1);
956
957 if (edge1_summary)
958 {
959 T *duplicate = summary->get_create (edge2);
960 summary->duplicate (edge1, edge2, edge1_summary, duplicate);
961 }
962}
963
964template <typename T, typename V>
965inline bool
970
971template <typename T>
972void
973gt_ggc_mx (fast_call_summary<T *, va_heap>* const &summary ATTRIBUTE_UNUSED)
974{
975}
976
977template <typename T>
978void
979gt_pch_nx (fast_call_summary<T *, va_heap>* const &summary ATTRIBUTE_UNUSED)
980{
981}
982
983template <typename T>
984void
985gt_pch_nx (fast_call_summary<T *, va_heap>* const& summary ATTRIBUTE_UNUSED,
986 gt_pointer_operator op ATTRIBUTE_UNUSED,
987 void *cookie ATTRIBUTE_UNUSED)
988{
989}
990
991template <typename T>
992void
994{
995 ggc_test_and_set_mark (summary->m_vector);
996 gt_ggc_mx (&summary->m_vector);
997}
998
999template <typename T>
1000void
1005
1006template <typename T>
1007void
1012
1013#endif /* GCC_SYMBOL_SUMMARY_H */
symbol_table * symtab
Definition cgraph.cc:81
void(* cgraph_edge_hook)(cgraph_edge *, void *)
Definition cgraph.h:2165
void(* cgraph_node_hook)(cgraph_node *, void *)
Definition cgraph.h:2166
void(* cgraph_2node_hook)(cgraph_node *, cgraph_node *, void *)
Definition cgraph.h:2169
void(* cgraph_2edge_hook)(cgraph_edge *, cgraph_edge *, void *)
Definition cgraph.h:2168
call_summary(symbol_table *symtab, bool ggc=false CXX_MEM_STAT_INFO)
Definition symbol-summary.h:679
hash_map< map_hash, T * > m_map
Definition symbol-summary.h:755
T * get(cgraph_edge *edge) ATTRIBUTE_PURE
Definition symbol-summary.h:709
bool m_ggc
Definition symbol-summary.h:743
friend void gt_pch_nx(call_summary< U * > *const &)
int_hash< int, 0, -1 > map_hash
Definition symbol-summary.h:752
friend void gt_pch_nx(call_summary< U * > *const &, gt_pointer_operator, void *)
bool is_ggc() final override
Definition symbol-summary.h:747
bool exists(cgraph_edge *edge)
Definition symbol-summary.h:729
T * get_create(cgraph_edge *edge)
Definition symbol-summary.h:698
void traverse(Arg a) const
Definition symbol-summary.h:691
friend void gt_ggc_mx(call_summary< U * > *const &)
void remove(cgraph_edge *edge)
Definition symbol-summary.h:717
Definition symbol-summary.h:566
cgraph_2edge_hook m_symtab_duplication
Definition symbol-summary.h:637
T * allocate_new()
Definition symbol-summary.h:611
virtual void remove(cgraph_edge *, T *)
Definition symbol-summary.h:582
virtual bool is_ggc()=0
object_allocator< T > m_allocator
Definition symbol-summary.h:651
bool m_initialize_when_cloning
Definition symbol-summary.h:644
cgraph_edge_hook m_symtab_removal
Definition symbol-summary.h:635
symbol_table * m_symtab
Definition symbol-summary.h:632
cgraph_edge_hook_list * m_symtab_removal_hook
Definition symbol-summary.h:640
void unregister_hooks()
Definition symbol-summary.h:656
void enable_duplication_hook()
Definition symbol-summary.h:591
virtual void duplicate(cgraph_edge *, cgraph_edge *, T *, T *)
Definition symbol-summary.h:585
cgraph_2edge_hook_list * m_symtab_duplication_hook
Definition symbol-summary.h:642
call_summary_base(symbol_table *symtab, cgraph_edge_hook symtab_removal, cgraph_2edge_hook symtab_duplication CXX_MEM_STAT_INFO)
Definition symbol-summary.h:569
void release(T *item)
Definition symbol-summary.h:620
void disable_duplication_hook()
Definition symbol-summary.h:600
Definition symbol-summary.h:667
Definition cgraph.h:1696
Definition genoutput.cc:147
T * get(cgraph_edge *edge) ATTRIBUTE_PURE
Definition symbol-summary.h:879
void remove(cgraph_edge *edge)
Definition symbol-summary.h:886
void traverse(Arg a) const
Definition symbol-summary.h:854
T * get_create(cgraph_edge *edge)
Definition symbol-summary.h:863
bool exists(cgraph_edge *edge)
Definition symbol-summary.h:897
fast_call_summary(symbol_table *symtab CXX_MEM_STAT_INFO)
Definition symbol-summary.h:840
Definition symbol-summary.h:827
void remove(cgraph_node *node)
Definition symbol-summary.h:412
T * get(cgraph_node *node) ATTRIBUTE_PURE
Definition symbol-summary.h:406
void traverse(Arg a) const
Definition symbol-summary.h:380
T * get_create(cgraph_node *node)
Definition symbol-summary.h:389
bool exists(cgraph_node *node)
Definition symbol-summary.h:423
Definition symbol-summary.h:358
friend void gt_pch_nx(function_summary< U * > *const &)
void traverse(Arg a) const
Definition symbol-summary.h:192
hash_map< map_hash, T * > m_map
Definition symbol-summary.h:259
bool is_ggc() final override
Definition symbol-summary.h:251
void remove(cgraph_node *node)
Definition symbol-summary.h:218
T * get(cgraph_node *node) ATTRIBUTE_PURE
Definition symbol-summary.h:210
int_hash< int, 0, -1 > map_hash
Definition symbol-summary.h:256
bool m_ggc
Definition symbol-summary.h:247
friend void gt_ggc_mx(function_summary< U * > *const &)
friend void gt_pch_nx(function_summary< U * > *const &, gt_pointer_operator, void *)
T * get_create(cgraph_node *node)
Definition symbol-summary.h:199
bool exists(cgraph_node *node)
Definition symbol-summary.h:230
Definition symbol-summary.h:28
virtual void remove(cgraph_node *, T *)
Definition symbol-summary.h:57
cgraph_node_hook_list * m_symtab_removal_hook
Definition symbol-summary.h:137
virtual void insert(cgraph_node *, T *)
Definition symbol-summary.h:49
virtual bool is_ggc()=0
cgraph_2node_hook m_symtab_duplication
Definition symbol-summary.h:132
void disable_duplication_hook()
Definition symbol-summary.h:93
void disable_insertion_hook()
Definition symbol-summary.h:75
cgraph_node_hook_list * m_symtab_insertion_hook
Definition symbol-summary.h:135
symbol_table * m_symtab
Definition symbol-summary.h:125
T * allocate_new()
Definition symbol-summary.h:104
cgraph_node_hook m_symtab_insertion
Definition symbol-summary.h:128
cgraph_2node_hook_list * m_symtab_duplication_hook
Definition symbol-summary.h:139
void enable_insertion_hook()
Definition symbol-summary.h:67
void unregister_hooks()
Definition symbol-summary.h:151
cgraph_node_hook m_symtab_removal
Definition symbol-summary.h:130
virtual void duplicate(cgraph_node *, cgraph_node *, T *, T *)
Definition symbol-summary.h:60
function_summary_base(symbol_table *symtab, cgraph_node_hook symtab_insertion, cgraph_node_hook symtab_removal, cgraph_2node_hook symtab_duplication CXX_MEM_STAT_INFO)
Definition symbol-summary.h:31
void enable_duplication_hook()
Definition symbol-summary.h:85
void release(T *item)
Definition symbol-summary.h:113
object_allocator< T > m_allocator
Definition symbol-summary.h:146
Definition symbol-summary.h:163
Definition alloc-pool.h:482
Definition cgraph.h:2223
cgraph_2edge_hook_list * add_edge_duplication_hook(cgraph_2edge_hook hook, void *data)
Definition cgraph.cc:422
void remove_cgraph_duplication_hook(cgraph_2node_hook_list *entry)
Definition cgraph.cc:480
cgraph_node_hook_list * add_cgraph_insertion_hook(cgraph_node_hook hook, void *data)
Definition cgraph.cc:393
void remove_cgraph_insertion_hook(cgraph_node_hook_list *entry)
Definition cgraph.cc:410
cgraph_2node_hook_list * add_cgraph_duplication_hook(cgraph_2node_hook hook, void *data)
Definition cgraph.cc:463
cgraph_node_hook_list * add_cgraph_removal_hook(cgraph_node_hook hook, void *data)
Definition cgraph.cc:339
cgraph_edge_hook_list * add_edge_removal_hook(cgraph_edge_hook hook, void *data)
Definition cgraph.cc:298
void remove_edge_duplication_hook(cgraph_2edge_hook_list *entry)
Definition cgraph.cc:439
class edge_def * edge
Definition coretypes.h:343
#define GTY(x)
Definition coretypes.h:41
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:463
void final(rtx_insn *first, FILE *file, int optimize_p)
Definition final.cc:2002
static void function_summary(const coverage_info *)
Definition gcov.cc:2655
void * ggc_internal_alloc(size_t size, void(*f)(void *), size_t, size_t MEM_STAT_DECL)
Definition ggc-none.cc:44
#define ggc_test_and_set_mark(EXPR)
Definition ggc.h:81
void ggc_delete(T *ptr)
Definition ggc.h:255
i
Definition poly-int.h:772
Ca & a
Definition poly-int.h:766
#define PASS_MEM_STAT
Definition statistics.h:54
#define MEM_STAT_DECL
Definition statistics.h:52
#define CXX_MEM_STAT_INFO
Definition statistics.h:58
Definition cgraph.cc:98
Definition cgraph.cc:105
Definition cgraph.cc:84
Definition cgraph.cc:91
Definition cgraph.h:875
int get_uid()
Definition cgraph.h:1303
int get_summary_id()
Definition cgraph.h:1309
Definition collect2.cc:168
Definition hash-traits.h:122
Definition symbol-summary.h:343
static const bool value
Definition symbol-summary.h:344
Definition vec.h:359
Definition vec.h:450
void gt_pch_nx(function_summary< T * > *const &)
Definition symbol-summary.h:327
void gt_ggc_mx(function_summary< T * > *const &summary)
Definition symbol-summary.h:319
#define NULL
Definition system.h:50
#define gcc_unreachable()
Definition system.h:848
#define true
Definition system.h:894
#define false
Definition system.h:895
#define gcc_checking_assert(EXPR)
Definition system.h:828
void vec_safe_grow_cleared(vec< T, A, vl_embed > *&v, unsigned len, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:768
void vec_alloc(vec< T, A, vl_embed > *&v, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:735
void vec_free(vec< T, A, vl_embed > *&v)
Definition vec.h:746