GCC Middle and Back End API Reference
ipa-prop.h
Go to the documentation of this file.
1/* Interprocedural analyses.
2 Copyright (C) 2005-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef IPA_PROP_H
21#define IPA_PROP_H
22
23/* The following definitions and interfaces are used by
24 interprocedural analyses or parameters. */
25
26#define IPA_UNDESCRIBED_USE -1
27
28/* Index identifying an actualargument or a formal parameter may have only this
29 many bits. */
30
31#define IPA_PROP_ARG_INDEX_LIMIT_BITS 16
32
33/* ipa-prop.cc stuff (ipa-cp, indirect inlining): */
34
35/* A jump function for a callsite represents the values passed as actual
36 arguments of the callsite. They were originally proposed in a paper called
37 "Interprocedural Constant Propagation", by David Callahan, Keith D Cooper,
38 Ken Kennedy, Linda Torczon in Comp86, pg 152-161. There are three main
39 types of values :
40
41 Pass-through - the caller's formal parameter is passed as an actual
42 argument, possibly one simple operation performed on it.
43 Constant - a constant (is_gimple_ip_invariant)is passed as an actual
44 argument.
45 Unknown - neither of the above.
46
47 IPA_JF_LOAD_AGG is a compound pass-through jump function, in which primary
48 operation on formal parameter is memory dereference that loads a value from
49 a part of an aggregate, which is represented or pointed to by the formal
50 parameter. Moreover, an additional unary/binary operation can be applied on
51 the loaded value, and final result is passed as actual argument of callee
52 (e.g. *(param_1(D) + 4) op 24 ). It is meant to describe usage of aggregate
53 parameter or by-reference parameter referenced in argument passing, commonly
54 found in C++ and Fortran.
55
56 IPA_JF_ANCESTOR is a special pass-through jump function, which means that
57 the result is an address of a part of the object pointed to by the formal
58 parameter to which the function refers. It is mainly intended to represent
59 getting addresses of ancestor fields in C++
60 (e.g. &this_1(D)->D.1766.D.1756). Note that if the original pointer is
61 NULL, ancestor jump function must behave like a simple pass-through.
62
63 Other pass-through functions can either simply pass on an unchanged formal
64 parameter or can apply one simple binary operation to it (such jump
65 functions are called polynomial).
66
67 Jump functions are computed in ipa-prop.cc by function
68 update_call_notes_after_inlining. Some information can be lost and jump
69 functions degraded accordingly when inlining, see
70 update_call_notes_after_inlining in the same file. */
71
73{
74 IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
75 IPA_JF_CONST, /* represented by field costant */
76 IPA_JF_PASS_THROUGH, /* represented by field pass_through */
77 IPA_JF_LOAD_AGG, /* represented by field load_agg */
78 IPA_JF_ANCESTOR /* represented by field ancestor */
79};
80
81struct ipa_cst_ref_desc;
82
83/* Structure holding data required to describe a constant jump function. */
85{
86 /* The value of the constant. */
88 /* Pointer to the structure that describes the reference. */
89 struct ipa_cst_ref_desc GTY((skip)) *rdesc;
90};
91
92/* Structure holding data required to describe a pass-through jump function. */
93
95{
96 /* If an operation is to be performed on the original parameter, this is the
97 second (constant) operand. */
99 /* Number of the caller's formal parameter being passed. */
101 /* Operation that is performed on the argument before it is passed on.
102 Special values which have other meaning than in normal contexts:
103 - NOP_EXPR means no operation, not even type conversion.
104 - ASSERT_EXPR means that only the value in operand is allowed to pass
105 through (without any change), for all other values the result is
106 unknown.
107 Otherwise operation must be a simple binary or unary arithmetic operation
108 where the caller's parameter is the first operand and (for binary
109 operations) the operand field from this structure is the second one. */
111 /* When the passed value is a pointer, it is set to true only when we are
112 certain that no write to the object it points to has occurred since the
113 caller functions started execution, except for changes noted in the
114 aggregate part of the jump function (see description of
115 ipa_agg_jump_function). The flag is used only when the operation is
116 NOP_EXPR. */
117 unsigned agg_preserved : 1;
118 /* Set when the edge has already been used to decrement an appropriate
119 reference description counter and should not be decremented again. */
121};
122
123/* Structure holding data required to describe a load-value-from-aggregate
124 jump function. */
125
127{
128 /* Inherit from pass through jump function, describing unary/binary
129 operation on the value loaded from aggregate that is represented or
130 pointed to by the formal parameter, specified by formal_id in this
131 pass_through jump function data structure. */
132 struct ipa_pass_through_data pass_through;
133 /* Type of the value loaded from the aggregate. */
135 /* Offset at which the value is located within the aggregate. */
136 HOST_WIDE_INT offset;
137 /* True if loaded by reference (the aggregate is pointed to by the formal
138 parameter) or false if loaded by value (the aggregate is represented
139 by the formal parameter). */
140 bool by_ref;
141};
142
143/* Structure holding data required to describe an ancestor pass-through
144 jump function. */
145
147{
148 /* Offset of the field representing the ancestor. */
149 HOST_WIDE_INT offset;
150 /* Number of the caller's formal parameter being passed. */
152 /* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */
153 unsigned agg_preserved : 1;
154 /* When set, the operation should not have any effect on NULL pointers. */
155 unsigned keep_null : 1;
156};
157
158/* A jump function for an aggregate part at a given offset, which describes how
159 it content value is generated. All unlisted positions are assumed to have a
160 value defined in an unknown way. */
161
163{
164 /* The offset for the aggregate part. */
165 HOST_WIDE_INT offset;
166
167 /* Data type of the aggregate part. */
169
170 /* Jump function type. */
172
173 /* Represents a value of jump function. constant represents the actual constant
174 in constant jump function content. pass_through is used only in simple pass
175 through jump function context. load_agg is for load-value-from-aggregate
176 jump function context. */
178 {
179 tree GTY ((tag ("IPA_JF_CONST"))) constant;
180 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
181 struct ipa_load_agg_data GTY ((tag ("IPA_JF_LOAD_AGG"))) load_agg;
182 } GTY ((desc ("%1.jftype"))) value;
183};
184
185/* Jump functions describing a set of aggregate contents. */
186
188{
189 /* Description of the individual jump function item. */
191 /* True if the data was passed by reference (as opposed to by value). */
192 bool by_ref;
193};
194
198
199/* Element of a vector describing aggregate values for a number of arguments in
200 a particular context, be it a call or the aggregate constants that a node is
201 specialized for. */
202
204{
205 /* The constant value. In the contexts where the list of known values is
206 being pruned, NULL means a variable value. */
208 /* Unit offset within the aggregate. */
209 unsigned unit_offset;
210 /* Index of the parameter, as it was in the original function (i.e. needs
211 remapping after parameter modification is carried out as part of clone
212 materialization). */
214 /* Whether the value was passed by reference. */
215 unsigned by_ref : 1;
216 /* Set if the value should not be used after materialization in
217 value_numbering. It is kept around just so that clone materialization can
218 distinguish a combined IPA-CP and IPA-SRA from a deleted argument. */
219 unsigned killed : 1;
220};
221
222/* A view into a sorted list of aggregate values in a particular context, be it
223 a call or the aggregate constants that a node is specialized for. The
224 actual data is stored in the vector this has been constructed from. */
225
227{
228public:
231 : m_elts (values)
232 {}
234 : m_elts (*values)
235 {}
239
240 /* Return the aggregate constant stored for INDEX at UNIT_OFFSET, if it is
241 passed by reference or not according to BY_REF, or NULL_TREE
242 otherwise. */
243
244 tree get_value (int index, unsigned unit_offset, bool by_ref) const;
245
246 /* Return the aggregate constant stored for INDEX at UNIT_OFFSET, not
247 performing any check of whether value is passed by reference. Return
248 NULL_TREE if there is no such constant. */
249
250 tree get_value (int index, unsigned unit_offset) const;
251
252 /* Return the item describing a constant stored for INDEX at UNIT_OFFSET or
253 NULL if there is no such constant. */
254
255 const ipa_argagg_value *get_elt (int index, unsigned unit_offset) const;
256
257
258 /* Return the first item describing a constant stored for parameter with
259 INDEX, regardless of offset or reference, or NULL if there is no such
260 constant. */
261
262 const ipa_argagg_value *get_elt_for_index (int index) const;
263
264 /* Return true if there is an aggregate constant referring to a value passed
265 in or by parameter with INDEX (at any offset, whether by reference or
266 not). */
267
268 bool value_for_index_p (int index) const
269 {
270 return !!get_elt_for_index (index);
271 }
272
273 /* Return true if all elements present in OTHER are also present in this
274 list. */
275
276 bool superset_of_p (const ipa_argagg_value_list &other) const;
277
278 /* Push all items in this list that describe parameter SRC_INDEX into RES as
279 ones describing DST_INDEX while subtracting UNIT_DELTA from their unit
280 offsets but skip those which would end up with a negative offset. */
281
282 void push_adjusted_values (unsigned src_index, unsigned dest_index,
283 unsigned unit_delta,
284 vec<ipa_argagg_value> *res) const;
285
286 /* Dump aggregate constants to FILE. */
287
288 void dump (FILE *f);
289
290 /* Dump aggregate constants to stderr. */
291
292 void DEBUG_FUNCTION debug ();
293
294 /* Array slice pointing to the actual storage. */
295
297};
298
299/* Info about value ranges. */
300
301class GTY(()) ipa_vr
302{
303public:
304 ipa_vr ();
305 ipa_vr (const vrange &);
306 void set_unknown ();
307 bool known_p () const { return m_storage != NULL; }
308 tree type () const { return m_type; }
309 void get_vrange (value_range &) const;
310 bool equal_p (const vrange &) const;
311 bool equal_p (const ipa_vr &) const;
312 const vrange_storage *storage () const { return m_storage; }
313 void streamer_read (lto_input_block *, class data_in *);
314 void streamer_write (output_block *) const;
315 void dump (FILE *) const;
316
317private:
318 friend void gt_pch_nx (struct ipa_vr &);
319 friend void gt_ggc_mx (struct ipa_vr &);
320 friend void gt_pch_nx (struct ipa_vr *, gt_pointer_operator, void *);
321 friend void gt_ggc_mx_ipa_vr (void *);
322 friend void gt_pch_nx_ipa_vr (void*);
323 friend void gt_pch_p_6ipa_vr(void*, void*, gt_pointer_operator, void*);
324
327};
328
329/* A jump function for a callsite represents the values passed as actual
330 arguments of the callsite. See enum jump_func_type for the various
331 types of jump functions supported. */
333{
334 /* Aggregate jump function description. See struct ipa_agg_jump_function
335 and its description. */
337
338 /* Information about value range, containing valid data only when vr_known is
339 true. The pointed to structure is shared betweed different jump
340 functions. Use ipa_set_jfunc_vr to set this field. */
342
344 /* Represents a value of a jump function. pass_through is used only in jump
345 function context. constant represents the actual constant in constant jump
346 functions and member_cst holds constant c++ member functions. */
348 {
349 struct ipa_constant_data GTY ((tag ("IPA_JF_CONST"))) constant;
350 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
351 struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
352 } GTY ((desc ("%1.type"))) value;
353};
354
355
356/* Return the constant stored in a constant jump functin JFUNC. */
357
358inline tree
360{
361 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
362 return jfunc->value.constant.value;
363}
364
365inline struct ipa_cst_ref_desc *
367{
369 return jfunc->value.constant.rdesc;
370}
371
372/* Make JFUNC not participate in any further reference counting. */
373
374inline void
380
381/* Return the operand of a pass through jmp function JFUNC. */
382
383inline tree
389
390/* Return the number of the caller's formal parameter that a pass through jump
391 function JFUNC refers to. */
392
393inline int
399
400/* Return operation of a pass through jump function JFUNC. */
401
402inline enum tree_code
408
409/* Return the agg_preserved flag of a pass through jump function JFUNC. */
410
411inline bool
417
418/* Return the refdesc_decremented flag of a pass through jump function
419 JFUNC. */
420
421inline bool
427
428/* Set the refdesc_decremented flag of a pass through jump function JFUNC to
429 VALUE. */
430
431inline void
437
438/* Return true if pass through jump function JFUNC preserves type
439 information. */
440
441inline bool
447
448/* Return the offset of an ancestor jump function JFUNC. */
449
450inline HOST_WIDE_INT
452{
454 return jfunc->value.ancestor.offset;
455}
456
457/* Return the number of the caller's formal parameter that an ancestor jump
458 function JFUNC refers to. */
459
460inline int
466
467/* Return the agg_preserved flag of an ancestor jump function JFUNC. */
468
469inline bool
475
476/* Return true if ancestor jump function JFUNC presrves type information. */
477
478inline bool
484
485/* Return if jfunc represents an operation whether we first check the formal
486 parameter for non-NULLness unless it does not matter because the offset is
487 zero anyway. */
488
489inline bool
495
496/* Class for allocating a bundle of various potentially known properties about
497 actual arguments of a particular call on stack for the usual case and on
498 heap only if there are unusually many arguments. The data is deallocated
499 when the instance of this class goes out of scope or is otherwise
500 destructed. */
501
503{
504public:
505 /* If m_known_vals (vector of known "scalar" values) is sufficiantly long,
506 return its element at INDEX, otherwise return NULL. */
507 tree safe_sval_at (int index)
508 {
509 if ((unsigned) index < m_known_vals.length ())
510 return m_known_vals[index];
511 return NULL;
512 }
513
514 /* Vector describing known values of parameters. */
516
517 /* Vector describing known polymorphic call contexts. */
519
520 /* Vector describing known aggregate values. */
522
523 /* Vector describing known value ranges of arguments. */
525};
526
527inline
528ipa_argagg_value_list
529::ipa_argagg_value_list (const ipa_auto_call_arg_values *aavals)
530 : m_elts (aavals->m_known_aggs)
531{}
532
533/* Class bundling the various potentially known properties about actual
534 arguments of a particular call. This variant does not deallocate the
535 bundled data in any way as the vectors can either be pointing to vectors in
536 ipa_auto_call_arg_values or be allocated independently. */
537
539{
540public:
541 /* Default constructor, setting the vectors to empty ones. */
544
545 /* Construct this general variant of the bundle from the variant which uses
546 auto_vecs to hold the vectors. This means that vectors of objects
547 constructed with this constructor should not be changed because if they
548 get reallocated, the member vectors and the underlying auto_vecs would get
549 out of sync. */
551 : m_known_vals (aavals->m_known_vals.to_vec_legacy ()),
552 m_known_contexts (aavals->m_known_contexts.to_vec_legacy ()),
553 m_known_aggs (aavals->m_known_aggs.to_vec_legacy ()),
554 m_known_value_ranges (aavals->m_known_value_ranges.to_vec_legacy ())
555 {}
556
557 /* If m_known_vals (vector of known "scalar" values) is sufficiantly long,
558 return its element at INDEX, otherwise return NULL. */
559 tree safe_sval_at (int index)
560 {
561 if ((unsigned) index < m_known_vals.length ())
562 return m_known_vals[index];
563 return NULL;
564 }
565
566 /* Vector describing known values of parameters. */
568
569 /* Vector describing known polymorphic call contexts. */
571
572 /* Vector describing known aggregate values. */
574
575 /* Vector describing known value ranges of arguments. */
577};
578
579inline
580ipa_argagg_value_list
581::ipa_argagg_value_list (const ipa_call_arg_values *gavals)
582 : m_elts (gavals->m_known_aggs)
583{}
584
585/* Summary describing a single formal parameter. */
586
588{
589 /* In analysis and modification phase, this is the PARAM_DECL of this
590 parameter, in IPA LTO phase, this is the type of the described
591 parameter or NULL if not known. Do not read this field directly but
592 through ipa_get_param and ipa_get_type as appropriate. */
594 /* If all uses of the parameter are described by ipa-prop structures, this
595 says how many there are. If any use could not be described by means of
596 ipa-prop structures (which include flag dereferenced below), this is
597 IPA_UNDESCRIBED_USE. */
599 unsigned int move_cost : 27;
600 /* The parameter is used. */
601 unsigned used : 1;
605 /* Set to true when in addition to being used in call statements, the
606 parameter has also been used for loads (but not for writes, does not
607 escape, etc.). This allows us to identify parameters p which are only
608 used as *p, and so when we propagate a constant to them, we can generate a
609 LOAD and not ADDR reference to them. */
610 unsigned load_dereferenced : 1;
611};
612
613/* ipa_node_params stores information related to formal parameters of functions
614 and some other information for interprocedural passes that operate on
615 parameters (such as ipa-cp). */
616
617class GTY((for_user)) ipa_node_params
618{
619public:
620 /* Default constructor. */
622
623 /* Default destructor. */
625
626 /* Information about individual formal parameters that are gathered when
627 summaries are generated. */
629 /* Pointer to an array of structures describing individual formal
630 parameters. */
632 /* Only for versioned nodes this field would not be NULL,
633 it points to the node that IPA cp cloned from. */
635 /* If this node is an ipa-cp clone, these are the known constants that
636 describe what it has been specialized for. */
638 /* If this node is an ipa-cp clone, these are the known polymorphic contexts
639 that describe what it has been specialized for. */
641 /* Whether the param uses analysis and jump function computation has already
642 been performed. */
643 unsigned analysis_done : 1;
644 /* Whether the function is enqueued in ipa-cp propagation stack. */
645 unsigned node_enqueued : 1;
646 /* Whether we should create a specialized version based on values that are
647 known to be constant in all contexts. */
649 /* Set if this is an IPA-CP clone for all contexts. */
651 /* Node has been completely replaced by clones and will be removed after
652 ipa-cp is finished. */
653 unsigned node_dead : 1;
654 /* Node is involved in a recursion, potentionally indirect. */
655 unsigned node_within_scc : 1;
656 /* Node contains only direct recursion. */
657 unsigned node_is_self_scc : 1;
658 /* Node is calling a private function called only once. */
660 /* False when there is something makes versioning impossible. */
661 unsigned versionable : 1;
662};
663
664inline
666: descriptors (NULL), lattices (vNULL), ipcp_orig_node (NULL),
667 known_csts (vNULL), known_contexts (vNULL), analysis_done (0),
668 node_enqueued (0), do_clone_for_all_contexts (0), is_all_contexts_clone (0),
669 node_dead (0), node_within_scc (0), node_is_self_scc (0),
670 node_calling_single_call (0), versionable (0)
671{
672}
673
674inline
676{
678 lattices.release ();
679 known_csts.release ();
680 known_contexts.release ();
681}
682
683/* Intermediate information that we get from alias analysis about a particular
684 parameter in a particular basic_block. When a parameter or the memory it
685 references is marked modified, we use that information in all dominated
686 blocks without consulting alias analysis oracle. */
687
689{
690 /* Set when this structure contains meaningful information. If not, the
691 structure describing a dominating BB should be used instead. */
692 bool valid;
693
694 /* Whether we have seen something which might have modified the data in
695 question. PARM is for the parameter itself, REF is for data it points to
696 but using the alias type of individual accesses and PT is the same thing
697 but for computing aggregate pass-through functions using a very inclusive
698 ao_ref. */
700};
701
702/* Information related to a given BB that used only when looking at function
703 body. */
704
706{
707 /* Call graph edges going out of this BB. */
709 /* Alias analysis statuses of each formal parameter at this bb. */
711};
712
713/* Structure with global information that is only used when looking at function
714 body. */
715
717{
718 /* The node that is being analyzed. */
720
721 /* Its info. */
723
724 /* Information about individual BBs. */
726
727 /* Number of parameters. */
729
730 /* Number of statements we are still allowed to walked by when analyzing this
731 function. */
732 unsigned int aa_walk_budget;
733};
734
735/* ipa_node_params access functions. Please use these to access fields that
736 are or will be shared among various passes. */
737
738/* Return the number of formal parameters. */
739
740inline int
742{
743 return vec_safe_length (info->descriptors);
744}
745
746/* Return the parameter declaration in DESCRIPTORS at index I and assert it is
747 indeed a PARM_DECL. */
748
749inline tree
751{
752 tree t = descriptors[i].decl_or_type;
753 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
754 return t;
755}
756
757/* Return the declaration of Ith formal parameter of the function corresponding
758 to INFO. Note there is no setter function as this array is built just once
759 using ipa_initialize_node_params. This function should not be called in
760 WPA. */
761
762inline tree
764{
766 return ipa_get_param (*info->descriptors, i);
767}
768
769/* Return the type of Ith formal parameter of the function corresponding
770 to INFO if it is known or NULL if not. */
771
772inline tree
774{
775 if (vec_safe_length (info->descriptors) <= (unsigned) i)
776 return NULL;
777 tree t = (*info->descriptors)[i].decl_or_type;
778 if (!t)
779 return NULL;
780 if (TYPE_P (t))
781 return t;
782 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
783 return TREE_TYPE (t);
784}
785
786/* Return the move cost of Ith formal parameter of the function corresponding
787 to INFO. */
788
789inline int
791{
793 return (*info->descriptors)[i].move_cost;
794}
795
796/* Set the used flag corresponding to the Ith formal parameter of the function
797 associated with INFO to VAL. */
798
799inline void
800ipa_set_param_used (class ipa_node_params *info, int i, bool val)
801{
803 (*info->descriptors)[i].used = val;
804}
805
806/* Set the used_by_ipa_predicates flag corresponding to the Ith formal
807 parameter of the function associated with INFO to VAL. */
808
809inline void
811{
813 (*info->descriptors)[i].used_by_ipa_predicates = val;
814}
815
816/* Set the used_by_indirect_call flag corresponding to the Ith formal
817 parameter of the function associated with INFO to VAL. */
818
819inline void
821{
823 (*info->descriptors)[i].used_by_indirect_call = val;
824}
825
826/* Set the .used_by_polymorphic_call flag corresponding to the Ith formal
827 parameter of the function associated with INFO to VAL. */
828
829inline void
831{
833 (*info->descriptors)[i].used_by_polymorphic_call = val;
834}
835
836/* Return how many uses described by ipa-prop a parameter has or
837 IPA_UNDESCRIBED_USE if there is a use that is not described by these
838 structures. */
839inline int
841{
842 /* FIXME: introducing speculation causes out of bounds access here. */
843 if (vec_safe_length (info->descriptors) > (unsigned)i)
844 return (*info->descriptors)[i].controlled_uses;
845 return IPA_UNDESCRIBED_USE;
846}
847
848/* Set the controlled counter of a given parameter. */
849
850inline void
851ipa_set_controlled_uses (class ipa_node_params *info, int i, int val)
852{
854 (*info->descriptors)[i].controlled_uses = val;
855}
856
857/* Assuming a parameter does not have IPA_UNDESCRIBED_USE controlled uses,
858 return flag which indicates it has been dereferenced but only in a load. */
859inline int
861{
863 return (*info->descriptors)[i].load_dereferenced;
864}
865
866/* Set the load_dereferenced flag of a given parameter. */
867
868inline void
870{
872 (*info->descriptors)[i].load_dereferenced = val;
873}
874
875/* Return the used flag corresponding to the Ith formal parameter of the
876 function associated with INFO. */
877
878inline bool
880{
882 return (*info->descriptors)[i].used;
883}
884
885/* Return the used_by_ipa_predicates flag corresponding to the Ith formal
886 parameter of the function associated with INFO. */
887
888inline bool
890{
892 return (*info->descriptors)[i].used_by_ipa_predicates;
893}
894
895/* Return the used_by_indirect_call flag corresponding to the Ith formal
896 parameter of the function associated with INFO. */
897
898inline bool
900{
902 return (*info->descriptors)[i].used_by_indirect_call;
903}
904
905/* Return the used_by_polymorphic_call flag corresponding to the Ith formal
906 parameter of the function associated with INFO. */
907
908inline bool
910{
912 return (*info->descriptors)[i].used_by_polymorphic_call;
913}
914
915/* GTY-marked structure used to map DECL_UIDs of APRAMs to their indices in
916 their DECL_ARGUMENTs chain. */
918{
919 /* DECL_UID of the PARAM. */
920 unsigned uid;
921 /* Its index in the DECL_ARGUMETs chain. */
922 unsigned index;
923};
924
925/* Structure holding information for the transformation phase of IPA-CP. */
926
928{
929 /* Default constructor. */
931 : m_agg_values (nullptr), m_vr (nullptr), m_uid_to_idx (nullptr)
932 { }
933
934 /* Default destructor. */
936 {
937 vec_free (m_agg_values);
938 vec_free (m_vr);
939 }
940
941 /* Given PARAM which must be a parameter of function FNDECL described by
942 THIS, return its index in the DECL_ARGUMENTS chain, using a pre-computed
943 DECL_UID-sorted vector if available (which is pre-computed only if there
944 are many parameters). Can return -1 if param is static chain not
945 represented among DECL_ARGUMENTS. */
946
947 int get_param_index (const_tree fndecl, const_tree param) const;
948
949 /* Assuming THIS describes FNDECL and it has sufficiently many parameters to
950 justify the overhead, create a DECL_UID-sorted vector to speed up mapping
951 from parameters to their indices in DECL_ARGUMENTS chain. */
952
953 void maybe_create_parm_idx_map (tree fndecl);
954
955 /* Remove all elements in m_agg_values on which PREDICATE returns true. */
956
957 template<typename pred_function>
958 void remove_argaggs_if (pred_function &&predicate)
959 {
960 unsigned ts_len = vec_safe_length (m_agg_values);
961 if (ts_len == 0)
962 return;
963
964 bool removed_item = false;
965 unsigned dst_index = 0;
966
967 for (unsigned i = 0; i < ts_len; i++)
968 {
969 ipa_argagg_value *v = &(*m_agg_values)[i];
970 if (!predicate (*v))
971 {
972 if (removed_item)
973 (*m_agg_values)[dst_index] = *v;
974 dst_index++;
975 }
976 else
977 removed_item = true;
978 }
979 if (dst_index == 0)
980 {
981 ggc_free (m_agg_values);
982 m_agg_values = NULL;
983 }
984 else if (removed_item)
985 m_agg_values->truncate (dst_index);
986 }
987
988 /* Known aggregate values. */
990 /* Value range information. */
992 /* If there are many parameters, this is a vector sorted by their DECL_UIDs
993 to map them to their indices in the DECL_ARGUMENT chain. */
995};
996
997inline
999 : m_elts (tinfo->m_agg_values)
1000{}
1001
1002void ipa_set_node_agg_value_chain (struct cgraph_node *node,
1006
1007/* ipa_edge_args stores information related to a callsite and particularly its
1008 arguments. It can be accessed by the IPA_EDGE_REF macro. */
1009
1010class GTY((for_user)) ipa_edge_args
1011{
1012 public:
1013
1014 /* Default constructor. */
1015 ipa_edge_args () : jump_functions (NULL), polymorphic_call_contexts (NULL)
1016 {}
1017
1018 /* Destructor. */
1020 {
1021 unsigned int i;
1022 ipa_jump_func *jf;
1023 FOR_EACH_VEC_SAFE_ELT (jump_functions, i, jf)
1024 vec_free (jf->agg.items);
1025 vec_free (jump_functions);
1026 vec_free (polymorphic_call_contexts);
1027 }
1028
1029 /* Vectors of the callsite's jump function and polymorphic context
1030 information of each parameter. */
1033};
1034
1035/* ipa_edge_args access functions. Please use these to access fields that
1036 are or will be shared among various passes. */
1037
1038/* Return the number of actual arguments. */
1039
1040inline int
1042{
1043 return vec_safe_length (args->jump_functions);
1044}
1045
1046/* Returns a pointer to the jump function for the ith argument. Please note
1047 there is no setter function as jump functions are all set up in
1048 ipa_compute_jump_functions. */
1049
1050inline struct ipa_jump_func *
1052{
1053 return &(*args->jump_functions)[i];
1054}
1055
1056/* Returns a pointer to the polymorphic call context for the ith argument.
1057 NULL if contexts are not computed. */
1058inline class ipa_polymorphic_call_context *
1060{
1061 if (!args->polymorphic_call_contexts)
1062 return NULL;
1063 return &(*args->polymorphic_call_contexts)[i];
1064}
1065
1066/* Function summary for ipa_node_params. */
1067class GTY((user)) ipa_node_params_t: public function_summary <ipa_node_params *>
1068{
1069public:
1072 {
1073 disable_insertion_hook ();
1074 }
1075
1076 /* Hook that is called by summary when a node is duplicated. */
1077 void duplicate (cgraph_node *node,
1078 cgraph_node *node2,
1080 ipa_node_params *data2) final override;
1081};
1082
1083/* Summary to manange ipa_edge_args structures. */
1084
1085class GTY((user)) ipa_edge_args_sum_t : public call_summary <ipa_edge_args *>
1086{
1087 public:
1090
1092 {
1093 call_summary <ipa_edge_args *>::remove (edge);
1094 }
1095
1096 /* Hook that is called by summary when an edge is removed. */
1097 void remove (cgraph_edge *cs, ipa_edge_args *args) final override;
1098 /* Hook that is called by summary when an edge is duplicated. */
1099 void duplicate (cgraph_edge *src,
1100 cgraph_edge *dst,
1101 ipa_edge_args *old_args,
1102 ipa_edge_args *new_args) final override;
1103};
1104
1105/* Function summary where the parameter infos are actually stored. */
1107/* Call summary to store information about edges such as jump functions. */
1109
1110/* Function summary for IPA-CP transformation. */
1113{
1114public:
1117
1119
1121 {
1122 ipcp_transformation_t *summary
1125 return summary;
1126 }
1127 /* Hook that is called by summary when a node is duplicated. */
1128 void duplicate (cgraph_node *node,
1129 cgraph_node *node2,
1131 ipcp_transformation *data2) final override;
1132};
1133
1134/* Function summary where the IPA CP transformations are actually stored. */
1136
1137/* Creating and freeing ipa_node_params and ipa_edge_args. */
1140void ipa_check_create_edge_args (void);
1141void ipa_free_all_node_params (void);
1142void ipa_free_all_edge_args (void);
1145
1146void ipa_register_cgraph_hooks (void);
1147int count_formal_params (tree fndecl);
1148
1149/* This function ensures the array of node param infos is big enough to
1150 accommodate a structure for all nodes and reallocates it if not. */
1151
1152inline void
1160
1161/* Returns true if edge summary contains a record for EDGE. The main purpose
1162 of this function is that debug dumping function can check info availability
1163 without causing allocations. */
1164
1165inline bool
1170
1171inline ipcp_transformation *
1173{
1175 return NULL;
1176
1177 return ipcp_transformation_sum->get (node);
1178}
1179
1180/* Function formal parameters related computations. */
1181void ipa_initialize_node_params (struct cgraph_node *node);
1182void ipa_print_constant_value (FILE *f, tree val);
1184 vec<cgraph_edge *> *new_edges);
1185
1186/* Indirect edge processing and target discovery. */
1188 ipa_call_arg_values *avals,
1189 bool *speculative);
1191 bool speculative = false);
1193
1194
1195/* Functions related to both. */
1196void ipa_analyze_node (struct cgraph_node *);
1197
1198/* Aggregate jump function related functions. */
1199tree ipa_find_agg_cst_from_init (tree scalar, HOST_WIDE_INT offset,
1200 bool by_ref);
1203 gimple *stmt, tree op, int *index_p,
1204 HOST_WIDE_INT *offset_p, poly_int64 *size_p,
1205 bool *by_ref, bool *guaranteed_unmodified = NULL);
1206
1207/* Debugging interface. */
1208void ipa_print_node_params (FILE *, struct cgraph_node *node);
1209void ipa_print_all_params (FILE *);
1210void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
1211void ipa_print_all_jump_functions (FILE * f);
1213
1214template <typename value>
1215class ipcp_value;
1216
1220
1221template <typename valtype>
1222struct ipcp_value_source;
1223
1225
1226struct ipcp_agg_lattice;
1227
1229
1236 struct ipa_jump_func *jfunc, tree type);
1238 const ipa_agg_jf_item *item);
1239unsigned int ipcp_transform_function (struct cgraph_node *node);
1241 cgraph_edge *,
1242 int,
1243 ipa_jump_func *);
1245 ipa_jump_func *, tree);
1247 ipa_agg_jump_function *agg_jfunc,
1248 unsigned dst_index,
1250void ipa_dump_param (FILE *, class ipa_node_params *info, int i);
1251void ipa_dump_jump_function (FILE *f, ipa_jump_func *jfunc,
1252 class ipa_polymorphic_call_context *ctx = NULL);
1256tree ipcp_get_aggregate_const (struct function *func, tree parm, bool by_ref,
1257 HOST_WIDE_INT bit_offset,
1258 HOST_WIDE_INT bit_size);
1260 poly_int64 *offset_ret);
1261
1262void ipa_prop_cc_finalize (void);
1263
1264/* From tree-sra.cc: */
1265tree build_ref_for_offset (location_t, tree, poly_int64, bool, tree,
1266 gimple_stmt_iterator *, bool);
1267
1268/* In ipa-cp.cc */
1269void ipa_cp_cc_finalize (void);
1270
1271/* Set R to the range of [VAL, VAL] while normalizing addresses to
1272 non-zero. */
1273
1274inline void
1276{
1277 if (TREE_CODE (val) == ADDR_EXPR)
1278 r.set_nonzero (TREE_TYPE (val));
1279 else
1280 r.set (val, val);
1281}
1282
1286
1287
1288#endif /* IPA_PROP_H */
symbol_table * symtab
Definition cgraph.cc:81
Definition vec.h:2362
Definition vec.h:1656
Definition symbol-summary.h:667
Definition cgraph.h:1696
unsigned int speculative
Definition cgraph.h:1950
Definition lto-streamer.h:754
Definition genoutput.cc:150
Definition symbol-summary.h:163
Definition ipa-prop.h:227
array_slice< const ipa_argagg_value > m_elts
Definition ipa-prop.h:296
tree get_value(int index, unsigned unit_offset, bool by_ref) const
Definition ipa-cp.cc:1108
const ipa_argagg_value * get_elt(int index, unsigned unit_offset) const
Definition ipa-cp.cc:1026
ipa_argagg_value_list(const vec< ipa_argagg_value > *values)
Definition ipa-prop.h:233
ipa_argagg_value_list(const vec< ipa_argagg_value, va_gc > *values)
Definition ipa-prop.h:230
const ipa_argagg_value * get_elt_for_index(int index) const
Definition ipa-cp.cc:1078
void DEBUG_FUNCTION debug()
Definition ipa-cp.cc:1017
void push_adjusted_values(unsigned src_index, unsigned dest_index, unsigned unit_delta, vec< ipa_argagg_value > *res) const
Definition ipa-cp.cc:1151
bool value_for_index_p(int index) const
Definition ipa-prop.h:268
ipa_argagg_value_list()=delete
bool superset_of_p(const ipa_argagg_value_list &other) const
Definition ipa-cp.cc:1121
void dump(FILE *f)
Definition ipa-cp.cc:997
Definition ipa-prop.h:503
auto_vec< value_range, 32 > m_known_value_ranges
Definition ipa-prop.h:524
auto_vec< ipa_polymorphic_call_context, 32 > m_known_contexts
Definition ipa-prop.h:518
auto_vec< tree, 32 > m_known_vals
Definition ipa-prop.h:515
auto_vec< ipa_argagg_value, 32 > m_known_aggs
Definition ipa-prop.h:521
tree safe_sval_at(int index)
Definition ipa-prop.h:507
Definition ipa-prop.h:539
vec< ipa_argagg_value > m_known_aggs
Definition ipa-prop.h:573
vec< tree > m_known_vals
Definition ipa-prop.h:567
ipa_call_arg_values()
Definition ipa-prop.h:542
tree safe_sval_at(int index)
Definition ipa-prop.h:559
vec< ipa_polymorphic_call_context > m_known_contexts
Definition ipa-prop.h:570
vec< value_range > m_known_value_ranges
Definition ipa-prop.h:576
ipa_call_arg_values(ipa_auto_call_arg_values *aavals)
Definition ipa-prop.h:550
Definition ipa-prop.h:1086
ipa_edge_args_sum_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1088
void duplicate(cgraph_edge *src, cgraph_edge *dst, ipa_edge_args *old_args, ipa_edge_args *new_args) final override
Definition ipa-prop.cc:4623
void remove(cgraph_edge *edge)
Definition ipa-prop.h:1091
Definition ipa-prop.h:1011
~ipa_edge_args()
Definition ipa-prop.h:1019
vec< ipa_polymorphic_call_context, va_gc > * polymorphic_call_contexts
Definition ipa-prop.h:1032
ipa_edge_args()
Definition ipa-prop.h:1015
vec< ipa_jump_func, va_gc > * jump_functions
Definition ipa-prop.h:1031
Definition ipa-prop.h:1068
void duplicate(cgraph_node *node, cgraph_node *node2, ipa_node_params *data, ipa_node_params *data2) final override
Definition ipa-prop.cc:4661
ipa_node_params_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1070
Definition ipa-prop.h:618
unsigned node_calling_single_call
Definition ipa-prop.h:659
unsigned versionable
Definition ipa-prop.h:661
unsigned node_dead
Definition ipa-prop.h:653
unsigned node_is_self_scc
Definition ipa-prop.h:657
vec< tree > known_csts
Definition ipa-prop.h:637
vec< ipa_param_descriptor, va_gc > * descriptors
Definition ipa-prop.h:628
vec< ipa_polymorphic_call_context > known_contexts
Definition ipa-prop.h:640
ipa_node_params()
Definition ipa-prop.h:665
unsigned node_within_scc
Definition ipa-prop.h:655
vec< ipcp_param_lattices > lattices
Definition ipa-prop.h:631
~ipa_node_params()
Definition ipa-prop.h:675
unsigned analysis_done
Definition ipa-prop.h:643
unsigned node_enqueued
Definition ipa-prop.h:645
unsigned do_clone_for_all_contexts
Definition ipa-prop.h:648
unsigned is_all_contexts_clone
Definition ipa-prop.h:650
struct cgraph_node * ipcp_orig_node
Definition ipa-prop.h:634
Definition cgraph.h:1555
Definition ipa-prop.h:302
bool equal_p(const vrange &) const
Definition ipa-prop.cc:153
friend void gt_pch_nx(struct ipa_vr *, gt_pointer_operator, void *)
tree type() const
Definition ipa-prop.h:308
ipa_vr()
Definition ipa-prop.cc:140
void dump(FILE *) const
Definition ipa-prop.cc:229
void streamer_read(lto_input_block *, class data_in *)
Definition ipa-prop.cc:190
bool known_p() const
Definition ipa-prop.h:307
vrange_storage * m_storage
Definition ipa-prop.h:325
friend void gt_ggc_mx(struct ipa_vr &)
friend void gt_pch_p_6ipa_vr(void *, void *, gt_pointer_operator, void *)
friend void gt_pch_nx(struct ipa_vr &)
void set_unknown()
Definition ipa-prop.cc:181
friend void gt_pch_nx_ipa_vr(void *)
const vrange_storage * storage() const
Definition ipa-prop.h:312
void get_vrange(value_range &) const
Definition ipa-prop.cc:174
void streamer_write(output_block *) const
Definition ipa-prop.cc:215
friend void gt_ggc_mx_ipa_vr(void *)
tree m_type
Definition ipa-prop.h:326
Definition ipa-prop.h:1113
static ipcp_transformation_t * create_ggc(symbol_table *symtab)
Definition ipa-prop.h:1120
~ipcp_transformation_t()
Definition ipa-prop.h:1118
ipcp_transformation_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1115
void duplicate(cgraph_node *node, cgraph_node *node2, ipcp_transformation *data, ipcp_transformation *data2) final override
Definition ipa-prop.cc:4679
Definition ipa-cp.h:71
Definition lto-streamer.h:338
Definition alloc-pool.h:482
Definition genmatch.cc:1485
Definition cgraph.h:2223
Definition value-range.h:759
Definition value-range-storage.h:50
Definition value-range.h:78
bool debug
Definition collect-utils.cc:34
class edge_def * edge
Definition coretypes.h:352
const union tree_node * const_tree
Definition coretypes.h:98
#define GTY(x)
Definition coretypes.h:41
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:473
union tree_node * tree
Definition coretypes.h:97
static struct table_elt * table[HASH_SIZE]
Definition cse.cc:470
void ggc_free(void *)
Definition genmatch.cc:42
tree_code
Definition genmatch.cc:992
T * ggc_alloc_no_dtor(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:200
void ipa_set_param_load_dereferenced(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:869
class ipa_polymorphic_call_context * ipa_get_ith_polymorhic_call_context(class ipa_edge_args *args, int i)
Definition ipa-prop.h:1059
int ipa_get_param_decl_index(class ipa_node_params *, tree)
Definition ipa-prop.cc:320
void ipa_cp_cc_finalize(void)
Definition ipa-cp.cc:6498
ipa_polymorphic_call_context ipa_context_from_jfunc(ipa_node_params *, cgraph_edge *, int, ipa_jump_func *)
Definition ipa-cp.cc:1594
bool ipa_get_jf_pass_through_type_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:442
void ipa_register_cgraph_hooks(void)
Definition ipa-prop.cc:4693
bool unadjusted_ptr_and_unit_offset(tree op, tree *ret, poly_int64 *offset_ret)
Definition ipa-prop.cc:1370
void ipa_prop_read_jump_functions(void)
Definition ipa-prop.cc:5389
bool ipa_get_jf_ancestor_keep_null(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:490
void ipa_initialize_node_params(struct cgraph_node *node)
Definition ipa-prop.cc:404
struct cgraph_edge * ipa_make_edge_direct_to_target(struct cgraph_edge *, tree, bool speculative=false)
Definition ipa-prop.cc:3496
object_allocator< ipcp_value< ipa_polymorphic_call_context > > ipcp_poly_ctx_values_pool
tree build_ref_for_offset(location_t, tree, poly_int64, bool, tree, gimple_stmt_iterator *, bool)
Definition tree-sra.cc:1879
struct ipa_cst_ref_desc * ipa_get_jf_constant_rdesc(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:366
void ipcp_verify_propagated_values(void)
Definition ipa-cp.cc:1915
tree ipa_agg_value_from_jfunc(ipa_node_params *info, cgraph_node *node, const ipa_agg_jf_item *item)
Definition ipa-cp.cc:1789
tree ipa_get_jf_pass_through_operand(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:384
int ipa_get_jf_ancestor_formal_id(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:461
void ipcp_write_transformation_summaries(void)
Definition ipa-prop.cc:5503
void ipa_set_param_used_by_polymorphic_call(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:830
bool ipa_get_jf_pass_through_agg_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:412
void ipa_release_body_info(struct ipa_func_body_info *)
Definition ipa-prop.cc:3148
bool ipa_propagate_indirect_call_infos(struct cgraph_edge *cs, vec< cgraph_edge * > *new_edges)
Definition ipa-prop.cc:4369
#define IPA_UNDESCRIBED_USE
Definition ipa-prop.h:26
void ipa_value_range_from_jfunc(vrange &, ipa_node_params *, cgraph_edge *, ipa_jump_func *, tree)
Definition ipa-cp.cc:1748
int ipa_get_param_move_cost(class ipa_node_params *info, int i)
Definition ipa-prop.h:790
bool ipa_is_param_used_by_polymorphic_call(class ipa_node_params *info, int i)
Definition ipa-prop.h:909
void ipcp_transformation_initialize(void)
Definition ipa-prop.cc:4449
void ipa_free_all_edge_args(void)
Definition ipa-prop.cc:4426
void ipa_free_all_node_params(void)
Definition ipa-prop.cc:4438
int ipa_get_jf_pass_through_formal_id(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:394
void ipa_check_create_node_params(void)
Definition ipa-prop.h:1153
void ipa_set_jf_pass_through_refdesc_decremented(ipa_jump_func *jfunc, bool value)
Definition ipa-prop.h:432
tree ipa_value_from_jfunc(class ipa_node_params *info, struct ipa_jump_func *jfunc, tree type)
Definition ipa-cp.cc:1545
HOST_WIDE_INT ipa_get_jf_ancestor_offset(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:451
void ipa_print_node_jump_functions(FILE *f, struct cgraph_node *node)
Definition ipa-prop.cc:566
unsigned int ipcp_transform_function(struct cgraph_node *node)
Definition ipa-prop.cc:5978
bool ipa_is_param_used_by_indirect_call(class ipa_node_params *info, int i)
Definition ipa-prop.h:899
void ipa_range_set_and_normalize(vrange &r, tree val)
Definition ipa-prop.h:1275
bool ipcp_get_parm_bits(tree, tree *, widest_int *)
Definition ipa-prop.cc:5805
tree ipa_impossible_devirt_target(struct cgraph_edge *, tree)
Definition ipa-prop.cc:3908
void ipa_set_param_used(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:800
bool ipa_jump_functions_equivalent_p(ipa_jump_func *jf1, ipa_jump_func *jf2)
Definition ipa-prop.cc:6194
object_allocator< ipcp_agg_lattice > ipcp_agg_lattice_pool
void ipa_create_all_node_params(void)
void ipa_set_param_used_by_indirect_call(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:820
bool ipa_is_param_used(class ipa_node_params *info, int i)
Definition ipa-prop.h:879
tree ipa_get_param(const vec< ipa_param_descriptor, va_gc > &descriptors, int i)
Definition ipa-prop.h:750
bool ipa_is_param_used_by_ipa_predicates(class ipa_node_params *info, int i)
Definition ipa-prop.h:889
void ipa_prop_write_jump_functions(void)
Definition ipa-prop.cc:5307
void ipcp_read_transformation_summaries(void)
Definition ipa-prop.cc:5587
bool ipa_return_value_range(value_range &range, tree decl)
Definition ipa-prop.cc:6080
void ipa_set_param_used_by_ipa_predicates(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:810
void ipa_dump_jump_function(FILE *f, ipa_jump_func *jfunc, class ipa_polymorphic_call_context *ctx=NULL)
Definition ipa-prop.cc:434
enum tree_code ipa_get_jf_pass_through_operation(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:403
tree ipa_find_agg_cst_from_init(tree scalar, HOST_WIDE_INT offset, bool by_ref)
Definition ipa-prop.cc:3736
void ipa_push_agg_values_from_jfunc(ipa_node_params *info, cgraph_node *node, ipa_agg_jump_function *agg_jfunc, unsigned dst_index, vec< ipa_argagg_value > *res)
Definition ipa-cp.cc:1880
int ipa_get_param_count(class ipa_node_params *info)
Definition ipa-prop.h:741
void ipa_check_create_edge_args(void)
Definition ipa-prop.cc:4413
void ipcp_free_transformation_sum(void)
Definition ipa-prop.cc:4463
void ipa_record_return_value_range(value_range val)
Definition ipa-prop.cc:6057
object_allocator< ipcp_value< tree > > ipcp_cst_values_pool
void ipa_print_constant_value(FILE *f, tree val)
Definition ipa-prop.cc:416
tree ipcp_get_aggregate_const(struct function *func, tree parm, bool by_ref, HOST_WIDE_INT bit_offset, HOST_WIDE_INT bit_size)
Definition ipa-prop.cc:5774
tree ipa_get_type(class ipa_node_params *info, int i)
Definition ipa-prop.h:773
tree ipa_get_callee_param_type(struct cgraph_edge *e, int i)
Definition ipa-prop.cc:2249
#define IPA_PROP_ARG_INDEX_LIMIT_BITS
Definition ipa-prop.h:31
void ipa_print_all_jump_functions(FILE *f)
Definition ipa-prop.cc:619
void ipa_free_all_structures_after_ipa_cp(void)
Definition ipa-prop.cc:4716
bool ipa_load_from_parm_agg(struct ipa_func_body_info *fbi, vec< ipa_param_descriptor, va_gc > *descriptors, gimple *stmt, tree op, int *index_p, HOST_WIDE_INT *offset_p, poly_int64 *size_p, bool *by_ref, bool *guaranteed_unmodified=NULL)
Definition ipa-prop.cc:1219
ipa_node_params_t * ipa_node_params_sum
Definition ipa-prop.cc:64
void ipa_create_all_edge_args(void)
tree ipa_get_indirect_edge_target(struct cgraph_edge *ie, ipa_call_arg_values *avals, bool *speculative)
Definition ipa-cp.cc:3199
ipa_edge_args_sum_t * ipa_edge_args_sum
Definition ipa-prop.cc:69
void ipa_print_all_params(FILE *)
Definition ipa-prop.cc:4795
bool ipa_get_jf_ancestor_type_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:479
void ipa_zap_jf_refdesc(ipa_jump_func *jfunc)
Definition ipa-prop.h:375
jump_func_type
Definition ipa-prop.h:73
@ IPA_JF_LOAD_AGG
Definition ipa-prop.h:77
@ IPA_JF_PASS_THROUGH
Definition ipa-prop.h:76
@ IPA_JF_UNKNOWN
Definition ipa-prop.h:74
@ IPA_JF_ANCESTOR
Definition ipa-prop.h:78
@ IPA_JF_CONST
Definition ipa-prop.h:75
int count_formal_params(tree fndecl)
Definition ipa-prop.cc:355
bool ipa_get_jf_ancestor_agg_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:470
void ipa_free_all_structures_after_iinln(void)
Definition ipa-prop.cc:4735
void ipa_prop_cc_finalize(void)
Definition ipa-prop.cc:6102
void ipa_print_node_params(FILE *, struct cgraph_node *node)
Definition ipa-prop.cc:4751
bool ipa_edge_args_info_available_for_edge_p(struct cgraph_edge *edge)
Definition ipa-prop.h:1166
int ipa_get_controlled_uses(class ipa_node_params *info, int i)
Definition ipa-prop.h:840
ipcp_transformation * ipcp_get_transformation_summary(cgraph_node *node)
Definition ipa-prop.h:1172
void ipa_analyze_node(struct cgraph_node *)
Definition ipa-prop.cc:3163
function_summary< ipcp_transformation * > * ipcp_transformation_sum
Definition ipa-prop.cc:66
void ipa_set_node_agg_value_chain(struct cgraph_node *node, vec< ipa_argagg_value, va_gc > *aggs)
Definition ipa-prop.cc:4476
void ipa_dump_param(FILE *, class ipa_node_params *info, int i)
Definition ipa-prop.cc:372
object_allocator< ipcp_value_source< tree > > ipcp_sources_pool
bool ipa_get_jf_pass_through_refdesc_decremented(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:422
int ipa_get_param_load_dereferenced(class ipa_node_params *info, int i)
Definition ipa-prop.h:860
int ipa_get_cs_argument_count(class ipa_edge_args *args)
Definition ipa-prop.h:1041
void ipa_set_controlled_uses(class ipa_node_params *info, int i, int val)
Definition ipa-prop.h:851
struct ipa_jump_func * ipa_get_ith_jump_func(class ipa_edge_args *args, int i)
Definition ipa-prop.h:1051
tree ipa_get_jf_constant(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:359
poly_int< N, C > r
Definition poly-int.h:774
i
Definition poly-int.h:776
rtx offset
Definition postreload.cc:691
Definition cgraph.h:875
unsigned versionable
Definition cgraph.h:1480
Definition genautomata.cc:499
Definition function.h:249
Definition gimple-iterator.h:26
Definition gimple.h:221
Definition ipa-prop.h:163
tree type
Definition ipa-prop.h:168
HOST_WIDE_INT offset
Definition ipa-prop.h:165
enum jump_func_type jftype
Definition ipa-prop.h:171
union ipa_agg_jf_item::jump_func_agg_value value
Definition ipa-prop.h:188
vec< ipa_agg_jf_item, va_gc > * items
Definition ipa-prop.h:190
bool by_ref
Definition ipa-prop.h:192
Definition ipa-prop.h:147
int formal_id
Definition ipa-prop.h:151
unsigned keep_null
Definition ipa-prop.h:155
unsigned agg_preserved
Definition ipa-prop.h:153
HOST_WIDE_INT offset
Definition ipa-prop.h:149
Definition ipa-prop.h:204
unsigned index
Definition ipa-prop.h:213
unsigned unit_offset
Definition ipa-prop.h:209
tree value
Definition ipa-prop.h:207
unsigned killed
Definition ipa-prop.h:219
unsigned by_ref
Definition ipa-prop.h:215
Definition ipa-prop.h:706
vec< cgraph_edge * > cg_edges
Definition ipa-prop.h:708
vec< ipa_param_aa_status > param_aa_statuses
Definition ipa-prop.h:710
Definition ipa-prop.h:85
struct ipa_cst_ref_desc * rdesc
Definition ipa-prop.h:89
tree value
Definition ipa-prop.h:87
Definition ipa-prop.cc:125
Definition ipa-prop.h:717
int param_count
Definition ipa-prop.h:728
class ipa_node_params * info
Definition ipa-prop.h:722
unsigned int aa_walk_budget
Definition ipa-prop.h:732
vec< ipa_bb_info > bb_infos
Definition ipa-prop.h:725
cgraph_node * node
Definition ipa-prop.h:719
Definition ipa-prop.h:333
ipa_vr * m_vr
Definition ipa-prop.h:341
enum jump_func_type type
Definition ipa-prop.h:343
struct ipa_agg_jump_function agg
Definition ipa-prop.h:336
union ipa_jump_func::jump_func_value value
Definition ipa-prop.h:127
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:132
tree type
Definition ipa-prop.h:134
bool by_ref
Definition ipa-prop.h:140
HOST_WIDE_INT offset
Definition ipa-prop.h:136
Definition ipa-prop.h:689
bool valid
Definition ipa-prop.h:692
bool parm_modified
Definition ipa-prop.h:699
bool pt_modified
Definition ipa-prop.h:699
bool ref_modified
Definition ipa-prop.h:699
Definition ipa-prop.h:588
unsigned used_by_polymorphic_call
Definition ipa-prop.h:604
unsigned int move_cost
Definition ipa-prop.h:599
unsigned load_dereferenced
Definition ipa-prop.h:610
tree decl_or_type
Definition ipa-prop.h:593
unsigned used_by_indirect_call
Definition ipa-prop.h:603
int controlled_uses
Definition ipa-prop.h:598
unsigned used_by_ipa_predicates
Definition ipa-prop.h:602
unsigned used
Definition ipa-prop.h:601
Definition ipa-prop.h:95
tree operand
Definition ipa-prop.h:98
unsigned agg_preserved
Definition ipa-prop.h:117
int formal_id
Definition ipa-prop.h:100
enum tree_code operation
Definition ipa-prop.h:110
unsigned refdesc_decremented
Definition ipa-prop.h:120
Definition ipa-prop.h:918
unsigned index
Definition ipa-prop.h:922
unsigned uid
Definition ipa-prop.h:920
Definition ipa-cp.h:161
Definition ipa-prop.h:928
void maybe_create_parm_idx_map(tree fndecl)
Definition ipa-cp.cc:6563
vec< ipa_uid_to_idx_map_elt, va_gc > * m_uid_to_idx
Definition ipa-prop.h:994
ipcp_transformation()
Definition ipa-prop.h:930
~ipcp_transformation()
Definition ipa-prop.h:935
vec< ipa_argagg_value, va_gc > * m_agg_values
Definition ipa-prop.h:989
void remove_argaggs_if(pred_function &&predicate)
Definition ipa-prop.h:958
vec< ipa_vr, va_gc > * m_vr
Definition ipa-prop.h:991
int get_param_index(const_tree fndecl, const_tree param) const
Definition ipa-cp.cc:6513
Definition ipa-cp.h:29
Definition lto-streamer.h:707
Definition gengtype.h:252
Definition vec.h:450
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814
#define DEBUG_FUNCTION
Definition system.h:1236
#define gcc_checking_assert(EXPR)
Definition system.h:821
static ccp_prop_value_t * get_value(tree var)
Definition tree-ssa-ccp.cc:370
#define TREE_CODE(NODE)
Definition tree.h:324
#define TYPE_P(NODE)
Definition tree.h:226
#define TREE_TYPE(NODE)
Definition tree.h:512
Definition ipa-prop.h:178
struct ipa_load_agg_data load_agg
Definition ipa-prop.h:181
tree constant
Definition ipa-prop.h:179
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:180
Definition ipa-prop.h:348
struct ipa_ancestor_jf_data ancestor
Definition ipa-prop.h:351
struct ipa_constant_data constant
Definition ipa-prop.h:349
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:350
#define FOR_EACH_VEC_SAFE_ELT(V, I, P)
Definition vec.h:1887
constexpr vnull vNULL
Definition vec.h:569
unsigned vec_safe_length(const vec< T, A, vl_embed > *v)
Definition vec.h:685
void vec_free(vec< T, A, vl_embed > *&v)
Definition vec.h:746