GCC Middle and Back End API Reference
ipa-prop.h
Go to the documentation of this file.
1/* Interprocedural analyses.
2 Copyright (C) 2005-2026 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 constant */
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 /* The result type of the operation. In case of no operation (represented by
100 NOP_EXPR) it should be NULL_TREE. */
102 /* Number of the caller's formal parameter being passed. */
104 /* Operation that is performed on the argument before it is passed on.
105 Special values which have other meaning than in normal contexts:
106 - NOP_EXPR means no operation, not even type conversion.
107 - ASSERT_EXPR means that only the value in operand is allowed to pass
108 through (without any change), for all other values the result is
109 unknown.
110 Otherwise operation must be a simple binary or unary arithmetic operation
111 where the caller's parameter is the first operand and (for binary
112 operations) the operand field from this structure is the second one. */
114 /* When the passed value is a pointer, it is set to true only when we are
115 certain that no write to the object it points to has occurred since the
116 caller functions started execution, except for changes noted in the
117 aggregate part of the jump function (see description of
118 ipa_agg_jump_function). The flag is used only when the operation is
119 NOP_EXPR. */
120 unsigned agg_preserved : 1;
121 /* Set when the edge has already been used to decrement an appropriate
122 reference description counter and should not be decremented again. */
124};
125
126/* Structure holding data required to describe a load-value-from-aggregate
127 jump function. */
128
130{
131 /* Inherit from pass through jump function, describing unary/binary
132 operation on the value loaded from aggregate that is represented or
133 pointed to by the formal parameter, specified by formal_id in this
134 pass_through jump function data structure. */
136 /* Type of the value loaded from the aggregate. */
138 /* Offset at which the value is located within the aggregate. */
139 HOST_WIDE_INT offset;
140 /* True if loaded by reference (the aggregate is pointed to by the formal
141 parameter) or false if loaded by value (the aggregate is represented
142 by the formal parameter). */
143 bool by_ref;
144};
145
146/* Structure holding data required to describe an ancestor pass-through
147 jump function. */
148
150{
151 /* Offset of the field representing the ancestor. */
152 HOST_WIDE_INT offset;
153 /* Number of the caller's formal parameter being passed. */
155 /* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */
156 unsigned agg_preserved : 1;
157 /* When set, the operation should not have any effect on NULL pointers. */
158 unsigned keep_null : 1;
159};
160
161/* A jump function for an aggregate part at a given offset, which describes how
162 it content value is generated. All unlisted positions are assumed to have a
163 value defined in an unknown way. */
164
166{
167 /* The offset for the aggregate part. */
168 HOST_WIDE_INT offset;
169
170 /* Data type of the aggregate part. */
172
173 /* Jump function type. */
175
176 /* Represents a value of jump function. constant represents the actual constant
177 in constant jump function content. pass_through is used only in simple pass
178 through jump function context. load_agg is for load-value-from-aggregate
179 jump function context. */
181 {
182 tree GTY ((tag ("IPA_JF_CONST"))) constant;
183 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
184 struct ipa_load_agg_data GTY ((tag ("IPA_JF_LOAD_AGG"))) load_agg;
185 } GTY ((desc ("%1.jftype"))) value;
186};
187
188/* Jump functions describing a set of aggregate contents. */
189
191{
192 /* Description of the individual jump function item. */
194 /* True if the data was passed by reference (as opposed to by value). */
195 bool by_ref;
196};
197
201
202/* Element of a vector describing aggregate values for a number of arguments in
203 a particular context, be it a call or the aggregate constants that a node is
204 specialized for. */
205
207{
208 /* The constant value. In the contexts where the list of known values is
209 being pruned, NULL means a variable value. */
211 /* Unit offset within the aggregate. */
212 unsigned unit_offset;
213 /* Index of the parameter, as it was in the original function (i.e. needs
214 remapping after parameter modification is carried out as part of clone
215 materialization). */
217 /* Whether the value was passed by reference. */
218 unsigned by_ref : 1;
219 /* Set if the value should not be used after materialization in
220 value_numbering. It is kept around just so that clone materialization can
221 distinguish a combined IPA-CP and IPA-SRA from a deleted argument. */
222 unsigned killed : 1;
223};
224
225/* A view into a sorted list of aggregate values in a particular context, be it
226 a call or the aggregate constants that a node is specialized for. The
227 actual data is stored in the vector this has been constructed from. */
228
230{
231public:
234 : m_elts (values)
235 {}
237 : m_elts (*values)
238 {}
242
243 /* Return the aggregate constant stored for INDEX at UNIT_OFFSET, if it is
244 passed by reference or not according to BY_REF, or NULL_TREE
245 otherwise. */
246
247 tree get_value (int index, unsigned unit_offset, bool by_ref) const;
248
249 /* Return the aggregate constant stored for INDEX at UNIT_OFFSET, not
250 performing any check of whether value is passed by reference. Return
251 NULL_TREE if there is no such constant. */
252
253 tree get_value (int index, unsigned unit_offset) const;
254
255 /* Return the item describing a constant stored for INDEX at UNIT_OFFSET or
256 NULL if there is no such constant. */
257
258 const ipa_argagg_value *get_elt (int index, unsigned unit_offset) const;
259
260
261 /* Return the first item describing a constant stored for parameter with
262 INDEX, regardless of offset or reference, or NULL if there is no such
263 constant. */
264
265 const ipa_argagg_value *get_elt_for_index (int index) const;
266
267 /* Return true if there is an aggregate constant referring to a value passed
268 in or by parameter with INDEX (at any offset, whether by reference or
269 not). */
270
271 bool value_for_index_p (int index) const
272 {
273 return !!get_elt_for_index (index);
274 }
275
276 /* Return true if all elements present in OTHER are also present in this
277 list. */
278
279 bool superset_of_p (const ipa_argagg_value_list &other) const;
280
281 /* Push all items in this list that describe parameter SRC_INDEX into RES as
282 ones describing DST_INDEX while subtracting UNIT_DELTA from their unit
283 offsets but skip those which would end up with a negative offset. */
284
285 void push_adjusted_values (unsigned src_index, unsigned dest_index,
286 unsigned unit_delta,
287 vec<ipa_argagg_value> *res) const;
288
289 /* Dump aggregate constants to FILE. */
290
291 void dump (FILE *f);
292
293 /* Dump aggregate constants to stderr. */
294
295 void DEBUG_FUNCTION debug ();
296
297 /* Array slice pointing to the actual storage. */
298
300};
301
302/* Info about value ranges. */
303
304class GTY(()) ipa_vr
305{
306public:
307 ipa_vr ();
308 ipa_vr (const vrange &);
309 void set_unknown ();
310 bool known_p () const { return m_storage != NULL; }
311 tree type () const { return m_type; }
312 void get_vrange (value_range &) const;
313 bool equal_p (const vrange &) const;
314 bool equal_p (const ipa_vr &) const;
315 const vrange_storage *storage () const { return m_storage; }
316 void streamer_read (lto_input_block *, class data_in *);
317 void streamer_write (output_block *) const;
318 void dump (FILE *) const;
319
320private:
321 friend void gt_pch_nx (struct ipa_vr &);
322 friend void gt_ggc_mx (struct ipa_vr &);
323 friend void gt_pch_nx (struct ipa_vr *, gt_pointer_operator, void *);
324 friend void gt_ggc_mx_ipa_vr (void *);
325 friend void gt_pch_nx_ipa_vr (void*);
326 friend void gt_pch_p_6ipa_vr(void*, void*, gt_pointer_operator, void*);
327
330};
331
332/* A jump function for a callsite represents the values passed as actual
333 arguments of the callsite. See enum jump_func_type for the various
334 types of jump functions supported. */
336{
337 /* Aggregate jump function description. See struct ipa_agg_jump_function
338 and its description. */
340
341 /* Information about value range, containing valid data only when vr_known is
342 true. The pointed to structure is shared betweed different jump
343 functions. Use ipa_set_jfunc_vr to set this field. */
345
347 /* Represents a value of a jump function. pass_through is used only in jump
348 function context. constant represents the actual constant in constant jump
349 functions and member_cst holds constant c++ member functions. */
351 {
352 struct ipa_constant_data GTY ((tag ("IPA_JF_CONST"))) constant;
353 struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
354 struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
355 } GTY ((desc ("%1.type"))) value;
356};
357
358
359/* Return the constant stored in a constant jump functin JFUNC. */
360
361inline tree
363{
364 gcc_checking_assert (jfunc->type == IPA_JF_CONST);
365 return jfunc->value.constant.value;
366}
367
368inline struct ipa_cst_ref_desc *
370{
372 return jfunc->value.constant.rdesc;
373}
374
375/* Make JFUNC not participate in any further reference counting. */
376
377inline void
383
384/* Return the operand of a pass through jmp function JFUNC. */
385
386inline tree
392
393/* Return the type of the operation in a non-NOP pass through jmp function
394 JFUNC. */
395
396inline tree
398{
400 && jfunc->value.pass_through.operation != NOP_EXPR);
401
402 return jfunc->value.pass_through.op_type;
403}
404
405/* Return the number of the caller's formal parameter that a pass through jump
406 function JFUNC refers to. */
407
408inline int
414
415/* Return operation of a pass through jump function JFUNC. */
416
417inline enum tree_code
423
424/* Return the agg_preserved flag of a pass through jump function JFUNC. */
425
426inline bool
432
433/* Return the refdesc_decremented flag of a pass through jump function
434 JFUNC. */
435
436inline bool
442
443/* Set the refdesc_decremented flag of a pass through jump function JFUNC to
444 VALUE. */
445
446inline void
452
453/* Return true if pass through jump function JFUNC preserves type
454 information. */
455
456inline bool
462
463/* Return the offset of an ancestor jump function JFUNC. */
464
465inline HOST_WIDE_INT
467{
469 return jfunc->value.ancestor.offset;
470}
471
472/* Return the number of the caller's formal parameter that an ancestor jump
473 function JFUNC refers to. */
474
475inline int
481
482/* Return the agg_preserved flag of an ancestor jump function JFUNC. */
483
484inline bool
490
491/* Return true if ancestor jump function JFUNC presrves type information. */
492
493inline bool
499
500/* Return if jfunc represents an operation whether we first check the formal
501 parameter for non-NULLness unless it does not matter because the offset is
502 zero anyway. */
503
504inline bool
510
511/* Class for allocating a bundle of various potentially known properties about
512 actual arguments of a particular call on stack for the usual case and on
513 heap only if there are unusually many arguments. The data is deallocated
514 when the instance of this class goes out of scope or is otherwise
515 destructed. */
516
518{
519public:
520 /* If m_known_vals (vector of known "scalar" values) is sufficiantly long,
521 return its element at INDEX, otherwise return NULL. */
522 tree safe_sval_at (int index)
523 {
524 if ((unsigned) index < m_known_vals.length ())
525 return m_known_vals[index];
526 return NULL;
527 }
528
529 /* Vector describing known values of parameters. */
531
532 /* Vector describing known polymorphic call contexts. */
534
535 /* Vector describing known aggregate values. */
537
538 /* Vector describing known value ranges of arguments. */
540};
541
542inline
543ipa_argagg_value_list
544::ipa_argagg_value_list (const ipa_auto_call_arg_values *aavals)
545 : m_elts (aavals->m_known_aggs)
546{}
547
548/* Class bundling the various potentially known properties about actual
549 arguments of a particular call. This variant does not deallocate the
550 bundled data in any way as the vectors can either be pointing to vectors in
551 ipa_auto_call_arg_values or be allocated independently. */
552
554{
555public:
556 /* Default constructor, setting the vectors to empty ones. */
559
560 /* Construct this general variant of the bundle from the variant which uses
561 auto_vecs to hold the vectors. This means that vectors of objects
562 constructed with this constructor should not be changed because if they
563 get reallocated, the member vectors and the underlying auto_vecs would get
564 out of sync. */
566 : m_known_vals (aavals->m_known_vals.to_vec_legacy ()),
567 m_known_contexts (aavals->m_known_contexts.to_vec_legacy ()),
568 m_known_aggs (aavals->m_known_aggs.to_vec_legacy ()),
569 m_known_value_ranges (aavals->m_known_value_ranges.to_vec_legacy ())
570 {}
571
572 /* If m_known_vals (vector of known "scalar" values) is sufficiantly long,
573 return its element at INDEX, otherwise return NULL. */
574 tree safe_sval_at (int index)
575 {
576 if ((unsigned) index < m_known_vals.length ())
577 return m_known_vals[index];
578 return NULL;
579 }
580
581 /* Vector describing known values of parameters. */
583
584 /* Vector describing known polymorphic call contexts. */
586
587 /* Vector describing known aggregate values. */
589
590 /* Vector describing known value ranges of arguments. */
592};
593
594inline
595ipa_argagg_value_list
596::ipa_argagg_value_list (const ipa_call_arg_values *gavals)
597 : m_elts (gavals->m_known_aggs)
598{}
599
600/* Summary describing a single formal parameter. */
601
603{
604 /* In analysis and modification phase, this is the PARAM_DECL of this
605 parameter, in IPA LTO phase, this is the type of the described
606 parameter or NULL if not known. Do not read this field directly but
607 through ipa_get_param and ipa_get_type as appropriate. */
609 /* If all uses of the parameter are described by ipa-prop structures, this
610 says how many there are. If any use could not be described by means of
611 ipa-prop structures (which include flag dereferenced below), this is
612 IPA_UNDESCRIBED_USE. */
614 unsigned int move_cost : 27;
615 /* The parameter is used. */
616 unsigned used : 1;
620 /* Set to true when in addition to being used in call statements, the
621 parameter has also been used for loads (but not for writes, does not
622 escape, etc.). This allows us to identify parameters p which are only
623 used as *p, and so when we propagate a constant to them, we can generate a
624 LOAD and not ADDR reference to them. */
625 unsigned load_dereferenced : 1;
626};
627
628/* ipa_node_params stores information related to formal parameters of functions
629 and some other information for interprocedural passes that operate on
630 parameters (such as ipa-cp). */
631
632class GTY((for_user)) ipa_node_params
633{
634public:
635 /* Default constructor. */
637
638 /* Default destructor. */
640
641 /* Information about individual formal parameters that are gathered when
642 summaries are generated. */
644 /* Pointer to an array of structures describing individual formal
645 parameters. */
647 /* Only for versioned nodes this field would not be NULL,
648 it points to the node that IPA cp cloned from. */
650 /* If this node is an ipa-cp clone, these are the known constants that
651 describe what it has been specialized for. */
653 /* If this node is an ipa-cp clone, these are the known polymorphic contexts
654 that describe what it has been specialized for. */
656 /* Whether the param uses analysis and jump function computation has already
657 been performed. */
658 unsigned analysis_done : 1;
659 /* Whether the function is enqueued in ipa-cp propagation stack. */
660 unsigned node_enqueued : 1;
661 /* Set if this is an IPA-CP clone for all contexts. */
663 /* Node has been completely replaced by clones and will be removed after
664 ipa-cp is finished. */
665 unsigned node_dead : 1;
666 /* Node is involved in a recursion, potentially indirect. */
667 unsigned node_within_scc : 1;
668 /* Node contains only direct recursion. */
669 unsigned node_is_self_scc : 1;
670 /* Node is calling a private function called only once. */
672 /* False when there is something makes versioning impossible. */
673 unsigned versionable : 1;
674};
675
676inline
685
686inline
688{
690 lattices.release ();
691 known_csts.release ();
692 known_contexts.release ();
693}
694
695/* Intermediate information that we get from alias analysis about a particular
696 parameter in a particular basic_block. When a parameter or the memory it
697 references is marked modified, we use that information in all dominated
698 blocks without consulting alias analysis oracle. */
699
701{
702 /* Set when this structure contains meaningful information. If not, the
703 structure describing a dominating BB should be used instead. */
704 bool valid;
705
706 /* Whether we have seen something which might have modified the data in
707 question. PARM is for the parameter itself, REF is for data it points to
708 but using the alias type of individual accesses and PT is the same thing
709 but for computing aggregate pass-through functions using a very inclusive
710 ao_ref. */
712};
713
714/* Information related to a given BB that used only when looking at function
715 body. */
716
718{
719 /* Call graph edges going out of this BB. */
721 /* Alias analysis statuses of each formal parameter at this bb. */
723};
724
725/* Structure with global information that is only used when looking at function
726 body. */
727
729{
730 /* The node that is being analyzed. */
732
733 /* Its info. */
735
736 /* Information about individual BBs. */
738
739 /* Number of parameters. */
741
742 /* Number of statements we are still allowed to walked by when analyzing this
743 function. */
744 unsigned int aa_walk_budget;
745};
746
747/* ipa_node_params access functions. Please use these to access fields that
748 are or will be shared among various passes. */
749
750/* Return the number of formal parameters. */
751
752inline int
754{
755 return vec_safe_length (info->descriptors);
756}
757
758/* Return the parameter declaration in DESCRIPTORS at index I and assert it is
759 indeed a PARM_DECL. */
760
761inline tree
763{
764 tree t = descriptors[i].decl_or_type;
765 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
766 return t;
767}
768
769/* Return the declaration of Ith formal parameter of the function corresponding
770 to INFO. Note there is no setter function as this array is built just once
771 using ipa_initialize_node_params. This function should not be called in
772 WPA. */
773
774inline tree
776{
778 return ipa_get_param (*info->descriptors, i);
779}
780
781/* Return the type of Ith formal parameter of the function corresponding
782 to INFO if it is known or NULL if not. */
783
784inline tree
786{
787 if (vec_safe_length (info->descriptors) <= (unsigned) i)
788 return NULL;
789 tree t = (*info->descriptors)[i].decl_or_type;
790 if (!t)
791 return NULL;
792 if (TYPE_P (t))
793 return t;
794 gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
795 return TREE_TYPE (t);
796}
797
798/* Return the move cost of Ith formal parameter of the function corresponding
799 to INFO. */
800
801inline int
803{
805 return (*info->descriptors)[i].move_cost;
806}
807
808/* Set the used flag corresponding to the Ith formal parameter of the function
809 associated with INFO to VAL. */
810
811inline void
812ipa_set_param_used (class ipa_node_params *info, int i, bool val)
813{
815 (*info->descriptors)[i].used = val;
816}
817
818/* Set the used_by_ipa_predicates flag corresponding to the Ith formal
819 parameter of the function associated with INFO to VAL. */
820
821inline void
823{
825 (*info->descriptors)[i].used_by_ipa_predicates = val;
826}
827
828/* Set the used_by_indirect_call flag corresponding to the Ith formal
829 parameter of the function associated with INFO to VAL. */
830
831inline void
833{
835 (*info->descriptors)[i].used_by_indirect_call = val;
836}
837
838/* Set the .used_by_polymorphic_call flag corresponding to the Ith formal
839 parameter of the function associated with INFO to VAL. */
840
841inline void
843{
845 (*info->descriptors)[i].used_by_polymorphic_call = val;
846}
847
848/* Return how many uses described by ipa-prop a parameter has or
849 IPA_UNDESCRIBED_USE if there is a use that is not described by these
850 structures. */
851inline int
853{
854 /* FIXME: introducing speculation causes out of bounds access here. */
855 if (vec_safe_length (info->descriptors) > (unsigned)i)
856 return (*info->descriptors)[i].controlled_uses;
857 return IPA_UNDESCRIBED_USE;
858}
859
860/* Set the controlled counter of a given parameter. */
861
862inline void
863ipa_set_controlled_uses (class ipa_node_params *info, int i, int val)
864{
866 (*info->descriptors)[i].controlled_uses = val;
867}
868
869/* Assuming a parameter does not have IPA_UNDESCRIBED_USE controlled uses,
870 return flag which indicates it has been dereferenced but only in a load. */
871inline int
873{
875 return (*info->descriptors)[i].load_dereferenced;
876}
877
878/* Set the load_dereferenced flag of a given parameter. */
879
880inline void
882{
884 (*info->descriptors)[i].load_dereferenced = val;
885}
886
887/* Return the used flag corresponding to the Ith formal parameter of the
888 function associated with INFO. */
889
890inline bool
892{
894 return (*info->descriptors)[i].used;
895}
896
897/* Return the used_by_ipa_predicates flag corresponding to the Ith formal
898 parameter of the function associated with INFO. */
899
900inline bool
902{
904 return (*info->descriptors)[i].used_by_ipa_predicates;
905}
906
907/* Return the used_by_indirect_call flag corresponding to the Ith formal
908 parameter of the function associated with INFO. */
909
910inline bool
912{
914 return (*info->descriptors)[i].used_by_indirect_call;
915}
916
917/* Return the used_by_polymorphic_call flag corresponding to the Ith formal
918 parameter of the function associated with INFO. */
919
920inline bool
922{
924 return (*info->descriptors)[i].used_by_polymorphic_call;
925}
926
927/* GTY-marked structure used to map DECL_UIDs of APRAMs to their indices in
928 their DECL_ARGUMENTs chain. */
930{
931 /* DECL_UID of the PARAM. */
932 unsigned uid;
933 /* Its index in the DECL_ARGUMETs chain. */
934 unsigned index;
935};
936
937/* Structure holding information for the transformation phase of IPA-CP. */
938
940{
941 /* Default constructor. */
943 : m_agg_values (nullptr), m_vr (nullptr), m_uid_to_idx (nullptr)
944 { }
945
946 /* Default destructor. */
952
953 /* Given PARAM which must be a parameter of function FNDECL described by
954 THIS, return its index in the DECL_ARGUMENTS chain, using a pre-computed
955 DECL_UID-sorted vector if available (which is pre-computed only if there
956 are many parameters). Can return -1 if param is static chain not
957 represented among DECL_ARGUMENTS. */
958
959 int get_param_index (const_tree fndecl, const_tree param) const;
960
961 /* Assuming THIS describes FNDECL and it has sufficiently many parameters to
962 justify the overhead, create a DECL_UID-sorted vector to speed up mapping
963 from parameters to their indices in DECL_ARGUMENTS chain. */
964
965 void maybe_create_parm_idx_map (tree fndecl);
966
967 /* Remove all elements in m_agg_values on which PREDICATE returns true. */
968
969 template<typename pred_function>
970 void remove_argaggs_if (pred_function &&predicate)
971 {
972 unsigned ts_len = vec_safe_length (m_agg_values);
973 if (ts_len == 0)
974 return;
975
976 bool removed_item = false;
977 unsigned dst_index = 0;
978
979 for (unsigned i = 0; i < ts_len; i++)
980 {
981 ipa_argagg_value *v = &(*m_agg_values)[i];
982 if (!predicate (*v))
983 {
984 if (removed_item)
985 (*m_agg_values)[dst_index] = *v;
986 dst_index++;
987 }
988 else
989 removed_item = true;
990 }
991 if (dst_index == 0)
992 {
995 }
996 else if (removed_item)
997 m_agg_values->truncate (dst_index);
998 }
999
1000 /* Known aggregate values. */
1002 /* Value range information. */
1004 /* If there are many parameters, this is a vector sorted by their DECL_UIDs
1005 to map them to their indices in the DECL_ARGUMENT chain. */
1007};
1008
1009inline
1011 : m_elts (tinfo->m_agg_values)
1012{}
1013
1018
1019/* ipa_edge_args stores information related to a callsite and particularly its
1020 arguments. It can be accessed by the IPA_EDGE_REF macro. */
1021
1022class GTY((for_user)) ipa_edge_args
1023{
1024 public:
1025
1026 /* Default constructor. */
1029
1030 /* Destructor. */
1032 {
1033 unsigned int i;
1034 ipa_jump_func *jf;
1036 vec_free (jf->agg.items);
1039 }
1040
1041 /* Vectors of the callsite's jump function and polymorphic context
1042 information of each parameter. */
1045};
1046
1047/* ipa_edge_args access functions. Please use these to access fields that
1048 are or will be shared among various passes. */
1049
1050/* Return the number of actual arguments. */
1051
1052inline int
1054{
1055 return vec_safe_length (args->jump_functions);
1056}
1057
1058/* Returns a pointer to the jump function for the ith argument. Please note
1059 there is no setter function as jump functions are all set up in
1060 ipa_compute_jump_functions. */
1061
1062inline struct ipa_jump_func *
1064{
1065 return &(*args->jump_functions)[i];
1066}
1067
1068/* Returns a pointer to the polymorphic call context for the ith argument.
1069 NULL if contexts are not computed. */
1070inline class ipa_polymorphic_call_context *
1072{
1073 if (!args->polymorphic_call_contexts)
1074 return NULL;
1075 return &(*args->polymorphic_call_contexts)[i];
1076}
1077
1078/* Function summary for ipa_node_params. */
1079class GTY((user)) ipa_node_params_t: public function_summary <ipa_node_params *>
1080{
1081public:
1084 {
1085 disable_insertion_hook ();
1086 }
1087
1088 /* Hook that is called by summary when a node is duplicated. */
1089 void duplicate (cgraph_node *node,
1090 cgraph_node *node2,
1092 ipa_node_params *data2) final override;
1093};
1094
1095/* Summary to manange ipa_edge_args structures. */
1096
1097class GTY((user)) ipa_edge_args_sum_t : public call_summary <ipa_edge_args *>
1098{
1099 public:
1102
1104 {
1105 call_summary <ipa_edge_args *>::remove (edge);
1106 }
1107
1108 /* Hook that is called by summary when an edge is removed. */
1109 void remove (cgraph_edge *cs, ipa_edge_args *args) final override;
1110 /* Hook that is called by summary when an edge is duplicated. */
1111 void duplicate (cgraph_edge *src,
1112 cgraph_edge *dst,
1113 ipa_edge_args *old_args,
1114 ipa_edge_args *new_args) final override;
1115};
1116
1117/* Function summary where the parameter infos are actually stored. */
1119/* Call summary to store information about edges such as jump functions. */
1121
1122/* Function summary for IPA-CP transformation. */
1125{
1126public:
1129
1131
1133 {
1134 ipcp_transformation_t *summary
1137 return summary;
1138 }
1139 /* Hook that is called by summary when a node is duplicated. */
1140 void duplicate (cgraph_node *node,
1141 cgraph_node *node2,
1143 ipcp_transformation *data2) final override;
1144};
1145
1146/* Function summary where the IPA CP transformations are actually stored. */
1148
1149/* Creating and freeing ipa_node_params and ipa_edge_args. */
1152void ipa_check_create_edge_args (void);
1153void ipa_free_all_node_params (void);
1154void ipa_free_all_edge_args (void);
1157
1158void ipa_register_cgraph_hooks (void);
1159int count_formal_params (tree fndecl);
1160
1161/* This function ensures the array of node param infos is big enough to
1162 accommodate a structure for all nodes and reallocates it if not. */
1163
1164inline void
1172
1173/* Returns true if edge summary contains a record for EDGE. The main purpose
1174 of this function is that debug dumping function can check info availability
1175 without causing allocations. */
1176
1177inline bool
1182
1183inline ipcp_transformation *
1185{
1187 return NULL;
1188
1189 return ipcp_transformation_sum->get (node);
1190}
1191
1192/* Function formal parameters related computations. */
1194void ipa_print_constant_value (FILE *f, tree val);
1196 vec<cgraph_edge *> *new_edges);
1197
1198/* Indirect edge processing and target discovery. */
1200 ipa_call_arg_values *avals,
1201 bool *speculative);
1203 bool speculative = false);
1205
1206
1207/* Functions related to both. */
1208void ipa_analyze_node (struct cgraph_node *);
1210
1211/* Aggregate jump function related functions. */
1212tree ipa_find_agg_cst_from_init (tree scalar, HOST_WIDE_INT offset,
1213 bool by_ref);
1216 gimple *stmt, tree op, int *index_p,
1217 HOST_WIDE_INT *offset_p, poly_int64 *size_p,
1218 bool *by_ref, bool *guaranteed_unmodified = NULL);
1219
1220/* Debugging interface. */
1221void ipa_print_node_params (FILE *, struct cgraph_node *node);
1222void ipa_print_all_params (FILE *);
1223void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
1224void ipa_print_all_jump_functions (FILE * f);
1226
1227template <typename value>
1228class ipcp_value;
1229
1233
1234template <typename valtype>
1235struct ipcp_value_source;
1236
1238
1239struct ipcp_agg_lattice;
1240
1242
1249 struct ipa_jump_func *jfunc, tree type);
1251 const ipa_agg_jf_item *item);
1252unsigned int ipcp_transform_function (struct cgraph_node *node);
1254 cgraph_edge *,
1255 int,
1256 ipa_jump_func *);
1258 ipa_jump_func *, tree);
1260 ipa_agg_jump_function *agg_jfunc,
1261 unsigned dst_index,
1263void ipa_dump_param (FILE *, class ipa_node_params *info, int i);
1264void ipa_dump_jump_function (FILE *f, ipa_jump_func *jfunc,
1265 class ipa_polymorphic_call_context *ctx = NULL);
1266void ipa_dump_noted_record_fnptrs (FILE *f);
1271tree ipcp_get_aggregate_const (struct function *func, tree parm, bool by_ref,
1272 HOST_WIDE_INT bit_offset,
1273 HOST_WIDE_INT bit_size);
1275 poly_int64 *offset_ret);
1278void ipa_prop_cc_finalize (void);
1280
1281/* In ipa-cp.cc */
1282void ipa_cp_cc_finalize (void);
1286
1287
1288#endif /* IPA_PROP_H */
symbol_table * symtab
Definition cgraph.cc:82
Definition vec.h:2373
Definition vec.h:1667
Definition cgraph.h:1869
unsigned int speculative
Definition cgraph.h:2161
Definition lto-streamer.h:756
Definition genoutput.cc:150
Definition symbol-summary.h:163
Definition ipa-prop.h:230
array_slice< const ipa_argagg_value > m_elts
Definition ipa-prop.h:299
tree get_value(int index, unsigned unit_offset, bool by_ref) const
Definition ipa-cp.cc:1202
const ipa_argagg_value * get_elt(int index, unsigned unit_offset) const
Definition ipa-cp.cc:1120
ipa_argagg_value_list(const vec< ipa_argagg_value > *values)
Definition ipa-prop.h:236
ipa_argagg_value_list(const vec< ipa_argagg_value, va_gc > *values)
Definition ipa-prop.h:233
const ipa_argagg_value * get_elt_for_index(int index) const
Definition ipa-cp.cc:1172
void DEBUG_FUNCTION debug()
Definition ipa-cp.cc:1111
void push_adjusted_values(unsigned src_index, unsigned dest_index, unsigned unit_delta, vec< ipa_argagg_value > *res) const
Definition ipa-cp.cc:1245
bool value_for_index_p(int index) const
Definition ipa-prop.h:271
ipa_argagg_value_list()=delete
bool superset_of_p(const ipa_argagg_value_list &other) const
Definition ipa-cp.cc:1215
void dump(FILE *f)
Definition ipa-cp.cc:1091
Definition ipa-prop.h:518
auto_vec< value_range, 32 > m_known_value_ranges
Definition ipa-prop.h:539
auto_vec< ipa_polymorphic_call_context, 32 > m_known_contexts
Definition ipa-prop.h:533
auto_vec< tree, 32 > m_known_vals
Definition ipa-prop.h:530
auto_vec< ipa_argagg_value, 32 > m_known_aggs
Definition ipa-prop.h:536
tree safe_sval_at(int index)
Definition ipa-prop.h:522
Definition ipa-prop.h:554
vec< ipa_argagg_value > m_known_aggs
Definition ipa-prop.h:588
vec< tree > m_known_vals
Definition ipa-prop.h:582
ipa_call_arg_values()
Definition ipa-prop.h:557
tree safe_sval_at(int index)
Definition ipa-prop.h:574
vec< ipa_polymorphic_call_context > m_known_contexts
Definition ipa-prop.h:585
vec< value_range > m_known_value_ranges
Definition ipa-prop.h:591
ipa_call_arg_values(ipa_auto_call_arg_values *aavals)
Definition ipa-prop.h:565
Definition ipa-prop.h:1098
ipa_edge_args_sum_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1100
void duplicate(cgraph_edge *src, cgraph_edge *dst, ipa_edge_args *old_args, ipa_edge_args *new_args) final override
Definition ipa-prop.cc:5114
void remove(cgraph_edge *edge)
Definition ipa-prop.h:1103
Definition ipa-prop.h:1023
~ipa_edge_args()
Definition ipa-prop.h:1031
vec< ipa_polymorphic_call_context, va_gc > * polymorphic_call_contexts
Definition ipa-prop.h:1044
ipa_edge_args()
Definition ipa-prop.h:1027
vec< ipa_jump_func, va_gc > * jump_functions
Definition ipa-prop.h:1043
Definition ipa-prop.h:1080
void duplicate(cgraph_node *node, cgraph_node *node2, ipa_node_params *data, ipa_node_params *data2) final override
Definition ipa-prop.cc:5152
ipa_node_params_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1082
Definition ipa-prop.h:633
unsigned node_calling_single_call
Definition ipa-prop.h:671
unsigned versionable
Definition ipa-prop.h:673
unsigned node_dead
Definition ipa-prop.h:665
unsigned node_is_self_scc
Definition ipa-prop.h:669
vec< tree > known_csts
Definition ipa-prop.h:652
vec< ipa_param_descriptor, va_gc > * descriptors
Definition ipa-prop.h:643
vec< ipa_polymorphic_call_context > known_contexts
Definition ipa-prop.h:655
ipa_node_params()
Definition ipa-prop.h:677
unsigned node_within_scc
Definition ipa-prop.h:667
vec< ipcp_param_lattices > lattices
Definition ipa-prop.h:646
~ipa_node_params()
Definition ipa-prop.h:687
unsigned analysis_done
Definition ipa-prop.h:658
unsigned node_enqueued
Definition ipa-prop.h:660
unsigned is_all_contexts_clone
Definition ipa-prop.h:662
struct cgraph_node * ipcp_orig_node
Definition ipa-prop.h:649
Definition cgraph.h:1621
Definition ipa-prop.h:305
bool equal_p(const vrange &) const
Definition ipa-prop.cc:157
friend void gt_pch_nx(struct ipa_vr *, gt_pointer_operator, void *)
tree type() const
Definition ipa-prop.h:311
ipa_vr()
Definition ipa-prop.cc:144
void dump(FILE *) const
Definition ipa-prop.cc:233
void streamer_read(lto_input_block *, class data_in *)
Definition ipa-prop.cc:194
bool known_p() const
Definition ipa-prop.h:310
vrange_storage * m_storage
Definition ipa-prop.h:328
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:185
friend void gt_pch_nx_ipa_vr(void *)
const vrange_storage * storage() const
Definition ipa-prop.h:315
void get_vrange(value_range &) const
Definition ipa-prop.cc:178
void streamer_write(output_block *) const
Definition ipa-prop.cc:219
friend void gt_ggc_mx_ipa_vr(void *)
tree m_type
Definition ipa-prop.h:329
static ipcp_transformation_t * create_ggc(symbol_table *symtab)
Definition ipa-prop.h:1132
~ipcp_transformation_t()
Definition ipa-prop.h:1130
ipcp_transformation_t(symbol_table *table, bool ggc)
Definition ipa-prop.h:1127
void duplicate(cgraph_node *node, cgraph_node *node2, ipcp_transformation *data, ipcp_transformation *data2) final override
Definition ipa-prop.cc:5170
Definition ipa-cp.h:71
Definition lto-streamer.h:338
Definition alloc-pool.h:482
Definition genmatch.cc:1495
Definition cgraph.h:2542
Definition value-range.h:761
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:369
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:490
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:52
tree_code
Definition genmatch.cc:1002
T * ggc_alloc_no_dtor(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:209
object_allocator< ipcp_value< ipa_polymorphic_call_context > > ipcp_poly_ctx_values_pool("IPA-CP polymorphic contexts")
object_allocator< ipcp_value_source< tree > > ipcp_sources_pool("IPA-CP value sources")
object_allocator< ipcp_agg_lattice > ipcp_agg_lattice_pool("IPA_CP aggregate lattices")
object_allocator< ipcp_value< tree > > ipcp_cst_values_pool("IPA-CP constant values")
void ipa_register_cgraph_hooks(void)
Definition ipa-prop.cc:5184
void ipa_free_all_edge_args(void)
Definition ipa-prop.cc:4917
void ipa_free_all_node_params(void)
Definition ipa-prop.cc:4929
void ipa_check_create_edge_args(void)
Definition ipa-prop.cc:4904
void ipa_free_all_structures_after_ipa_cp(void)
Definition ipa-prop.cc:5207
ipa_node_params_t * ipa_node_params_sum
Definition ipa-prop.cc:68
ipa_edge_args_sum_t * ipa_edge_args_sum
Definition ipa-prop.cc:73
int count_formal_params(tree fndecl)
Definition ipa-prop.cc:406
void ipa_free_all_structures_after_iinln(void)
Definition ipa-prop.cc:5226
function_summary< ipcp_transformation * > * ipcp_transformation_sum
Definition ipa-prop.cc:70
void ipa_set_param_load_dereferenced(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:881
class ipa_polymorphic_call_context * ipa_get_ith_polymorhic_call_context(class ipa_edge_args *args, int i)
Definition ipa-prop.h:1071
int ipa_get_param_decl_index(class ipa_node_params *, tree)
Definition ipa-prop.cc:367
void ipa_cp_cc_finalize(void)
Definition ipa-cp.cc:6842
ipa_polymorphic_call_context ipa_context_from_jfunc(ipa_node_params *, cgraph_edge *, int, ipa_jump_func *)
Definition ipa-cp.cc:1688
bool ipa_get_jf_pass_through_type_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:457
void ipa_register_cgraph_hooks(void)
Definition ipa-prop.cc:5184
bool unadjusted_ptr_and_unit_offset(tree op, tree *ret, poly_int64 *offset_ret)
Definition ipa-prop.cc:1419
void ipa_prop_read_jump_functions(void)
Definition ipa-prop.cc:6060
bool ipa_get_jf_ancestor_keep_null(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:505
void ipa_initialize_node_params(struct cgraph_node *node)
Definition ipa-prop.cc:455
struct cgraph_edge * ipa_make_edge_direct_to_target(struct cgraph_edge *, tree, bool speculative=false)
Definition ipa-prop.cc:3981
struct ipa_cst_ref_desc * ipa_get_jf_constant_rdesc(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:369
void ipcp_verify_propagated_values(void)
Definition ipa-cp.cc:2029
tree ipa_agg_value_from_jfunc(ipa_node_params *info, cgraph_node *node, const ipa_agg_jf_item *item)
Definition ipa-cp.cc:1902
tree ipa_get_jf_pass_through_operand(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:387
int ipa_get_jf_ancestor_formal_id(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:476
void ipcp_write_transformation_summaries(void)
Definition ipa-prop.cc:6175
void ipa_set_param_used_by_polymorphic_call(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:842
bool ipa_get_jf_pass_through_agg_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:427
void ipa_release_body_info(struct ipa_func_body_info *)
Definition ipa-prop.cc:3547
bool ipa_propagate_indirect_call_infos(struct cgraph_edge *cs, vec< cgraph_edge * > *new_edges)
Definition ipa-prop.cc:4860
tree ipa_single_noted_fnptr_in_record(tree rectype, unsigned offset)
Definition ipa-prop.cc:3305
#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:1860
int ipa_get_param_move_cost(class ipa_node_params *info, int i)
Definition ipa-prop.h:802
bool ipa_is_param_used_by_polymorphic_call(class ipa_node_params *info, int i)
Definition ipa-prop.h:921
void ipcp_transformation_initialize(void)
Definition ipa-prop.cc:4940
void ipa_free_all_edge_args(void)
Definition ipa-prop.cc:4917
void ipa_free_all_node_params(void)
Definition ipa-prop.cc:4929
int ipa_get_jf_pass_through_formal_id(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:409
void ipa_check_create_node_params(void)
Definition ipa-prop.h:1165
void ipa_set_jf_pass_through_refdesc_decremented(ipa_jump_func *jfunc, bool value)
Definition ipa-prop.h:447
tree ipa_value_from_jfunc(class ipa_node_params *info, struct ipa_jump_func *jfunc, tree type)
Definition ipa-cp.cc:1627
HOST_WIDE_INT ipa_get_jf_ancestor_offset(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:466
void ipa_print_node_jump_functions(FILE *f, struct cgraph_node *node)
Definition ipa-prop.cc:626
unsigned int ipcp_transform_function(struct cgraph_node *node)
Definition ipa-prop.cc:6651
bool ipa_is_param_used_by_indirect_call(class ipa_node_params *info, int i)
Definition ipa-prop.h:911
bool ipcp_get_parm_bits(tree, tree *, widest_int *)
Definition ipa-prop.cc:6478
void ipa_dump_noted_record_fnptrs(FILE *f)
Definition ipa-prop.cc:3267
tree ipa_impossible_devirt_target(struct cgraph_edge *, tree)
Definition ipa-prop.cc:4394
void ipa_set_param_used(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:812
bool ipa_jump_functions_equivalent_p(ipa_jump_func *jf1, ipa_jump_func *jf2)
Definition ipa-prop.cc:6857
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:832
bool ipa_is_param_used(class ipa_node_params *info, int i)
Definition ipa-prop.h:891
tree ipa_get_param(const vec< ipa_param_descriptor, va_gc > &descriptors, int i)
Definition ipa-prop.h:762
bool ipa_is_param_used_by_ipa_predicates(class ipa_node_params *info, int i)
Definition ipa-prop.h:901
void ipa_prop_write_jump_functions(void)
Definition ipa-prop.cc:5896
void ipcp_read_transformation_summaries(void)
Definition ipa-prop.cc:6260
void ipa_free_noted_fnptr_calls()
Definition ipa-prop.cc:3325
void ipa_analyze_var_static_initializer(varpool_node *node)
Definition ipa-prop.cc:3626
bool ipa_return_value_range(value_range &range, tree decl)
Definition ipa-prop.cc:6739
void ipa_get_range_from_ip_invariant(vrange &r, tree val, cgraph_node *node)
Definition ipa-prop.cc:2383
void ipa_set_param_used_by_ipa_predicates(class ipa_node_params *info, int i, bool val)
Definition ipa-prop.h:822
void ipa_debug_noted_record_fnptrs(void)
Definition ipa-prop.cc:3294
void ipa_dump_jump_function(FILE *f, ipa_jump_func *jfunc, class ipa_polymorphic_call_context *ctx=NULL)
Definition ipa-prop.cc:485
enum tree_code ipa_get_jf_pass_through_operation(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:418
tree ipa_find_agg_cst_from_init(tree scalar, HOST_WIDE_INT offset, bool by_ref)
Definition ipa-prop.cc:4223
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:1994
int ipa_get_param_count(class ipa_node_params *info)
Definition ipa-prop.h:753
void ipa_check_create_edge_args(void)
Definition ipa-prop.cc:4904
void ipcp_free_transformation_sum(void)
Definition ipa-prop.cc:4954
void ipa_record_return_value_range(value_range val)
Definition ipa-prop.cc:6730
void ipa_print_constant_value(FILE *f, tree val)
Definition ipa-prop.cc:467
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:6447
tree ipa_get_type(class ipa_node_params *info, int i)
Definition ipa-prop.h:785
tree ipa_get_callee_param_type(struct cgraph_edge *e, int i)
Definition ipa-prop.cc:2313
#define IPA_PROP_ARG_INDEX_LIMIT_BITS
Definition ipa-prop.h:31
void ipa_print_all_jump_functions(FILE *f)
Definition ipa-prop.cc:664
void ipa_free_all_structures_after_ipa_cp(void)
Definition ipa-prop.cc:5207
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:1268
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:3319
void ipa_print_all_params(FILE *)
Definition ipa-prop.cc:5286
bool ipa_get_jf_ancestor_type_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:494
void ipa_zap_jf_refdesc(ipa_jump_func *jfunc)
Definition ipa-prop.h:378
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:406
bool ipa_get_jf_ancestor_agg_preserved(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:485
void ipa_free_all_structures_after_iinln(void)
Definition ipa-prop.cc:5226
tree ipa_get_jf_pass_through_op_type(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:397
void ipa_prop_cc_finalize(void)
Definition ipa-prop.cc:6761
void ipa_print_node_params(FILE *, struct cgraph_node *node)
Definition ipa-prop.cc:5242
bool ipa_edge_args_info_available_for_edge_p(struct cgraph_edge *edge)
Definition ipa-prop.h:1178
int ipa_get_controlled_uses(class ipa_node_params *info, int i)
Definition ipa-prop.h:852
ipcp_transformation * ipcp_get_transformation_summary(cgraph_node *node)
Definition ipa-prop.h:1184
void ipa_analyze_node(struct cgraph_node *)
Definition ipa-prop.cc:3562
void ipa_set_node_agg_value_chain(struct cgraph_node *node, vec< ipa_argagg_value, va_gc > *aggs)
Definition ipa-prop.cc:4967
void ipa_dump_param(FILE *, class ipa_node_params *info, int i)
Definition ipa-prop.cc:423
bool ipa_get_jf_pass_through_refdesc_decremented(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:437
int ipa_get_param_load_dereferenced(class ipa_node_params *info, int i)
Definition ipa-prop.h:872
int ipa_get_cs_argument_count(class ipa_edge_args *args)
Definition ipa-prop.h:1053
void ipa_set_controlled_uses(class ipa_node_params *info, int i, int val)
Definition ipa-prop.h:863
struct ipa_jump_func * ipa_get_ith_jump_func(class ipa_edge_args *args, int i)
Definition ipa-prop.h:1063
tree ipa_get_jf_constant(struct ipa_jump_func *jfunc)
Definition ipa-prop.h:362
Definition custom-sarif-properties/state-graphs.h:33
poly_int< NUM_POLY_INT_COEFFS, HOST_WIDE_INT > poly_int64
Definition poly-int-types.h:24
poly_int< N, C > r
Definition poly-int.h:774
i
Definition poly-int.h:776
Definition cgraph.h:920
Definition genautomata.cc:499
Definition function.h:249
Definition gimple.h:221
Definition ipa-prop.h:166
tree type
Definition ipa-prop.h:171
HOST_WIDE_INT offset
Definition ipa-prop.h:168
enum jump_func_type jftype
Definition ipa-prop.h:174
union ipa_agg_jf_item::jump_func_agg_value value
Definition ipa-prop.h:191
vec< ipa_agg_jf_item, va_gc > * items
Definition ipa-prop.h:193
bool by_ref
Definition ipa-prop.h:195
Definition ipa-prop.h:150
int formal_id
Definition ipa-prop.h:154
unsigned keep_null
Definition ipa-prop.h:158
unsigned agg_preserved
Definition ipa-prop.h:156
HOST_WIDE_INT offset
Definition ipa-prop.h:152
Definition ipa-prop.h:207
unsigned index
Definition ipa-prop.h:216
unsigned unit_offset
Definition ipa-prop.h:212
tree value
Definition ipa-prop.h:210
unsigned killed
Definition ipa-prop.h:222
unsigned by_ref
Definition ipa-prop.h:218
Definition ipa-prop.h:718
vec< cgraph_edge * > cg_edges
Definition ipa-prop.h:720
vec< ipa_param_aa_status > param_aa_statuses
Definition ipa-prop.h:722
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:129
Definition ipa-prop.h:729
int param_count
Definition ipa-prop.h:740
class ipa_node_params * info
Definition ipa-prop.h:734
unsigned int aa_walk_budget
Definition ipa-prop.h:744
vec< ipa_bb_info > bb_infos
Definition ipa-prop.h:737
Definition ipa-prop.h:336
ipa_vr * m_vr
Definition ipa-prop.h:344
enum jump_func_type type
Definition ipa-prop.h:346
struct ipa_agg_jump_function agg
Definition ipa-prop.h:339
union ipa_jump_func::jump_func_value value
Definition ipa-prop.h:130
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:135
tree type
Definition ipa-prop.h:137
bool by_ref
Definition ipa-prop.h:143
HOST_WIDE_INT offset
Definition ipa-prop.h:139
Definition ipa-prop.h:701
bool valid
Definition ipa-prop.h:704
bool parm_modified
Definition ipa-prop.h:711
bool pt_modified
Definition ipa-prop.h:711
bool ref_modified
Definition ipa-prop.h:711
Definition ipa-prop.h:603
unsigned used_by_polymorphic_call
Definition ipa-prop.h:619
unsigned int move_cost
Definition ipa-prop.h:614
unsigned load_dereferenced
Definition ipa-prop.h:625
tree decl_or_type
Definition ipa-prop.h:608
unsigned used_by_indirect_call
Definition ipa-prop.h:618
int controlled_uses
Definition ipa-prop.h:613
unsigned used_by_ipa_predicates
Definition ipa-prop.h:617
unsigned used
Definition ipa-prop.h:616
Definition ipa-prop.h:95
tree operand
Definition ipa-prop.h:98
unsigned agg_preserved
Definition ipa-prop.h:120
int formal_id
Definition ipa-prop.h:103
enum tree_code operation
Definition ipa-prop.h:113
tree op_type
Definition ipa-prop.h:101
unsigned refdesc_decremented
Definition ipa-prop.h:123
Definition ipa-prop.h:930
unsigned index
Definition ipa-prop.h:934
unsigned uid
Definition ipa-prop.h:932
Definition ipa-cp.h:161
HOST_WIDE_INT offset
Definition ipa-cp.h:164
Definition ipa-prop.h:940
void maybe_create_parm_idx_map(tree fndecl)
Definition ipa-cp.cc:6906
vec< ipa_uid_to_idx_map_elt, va_gc > * m_uid_to_idx
Definition ipa-prop.h:1006
ipcp_transformation()
Definition ipa-prop.h:942
~ipcp_transformation()
Definition ipa-prop.h:947
vec< ipa_argagg_value, va_gc > * m_agg_values
Definition ipa-prop.h:1001
void remove_argaggs_if(pred_function &&predicate)
Definition ipa-prop.h:970
vec< ipa_vr, va_gc > * m_vr
Definition ipa-prop.h:1003
int get_param_index(const_tree fndecl, const_tree param) const
Definition ipa-cp.cc:6856
Definition ipa-cp.h:29
Definition lto-streamer.h:709
Definition gengtype.h:252
Definition cgraph.h:2232
Definition vec.h:450
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:817
#define DEBUG_FUNCTION
Definition system.h:1239
#define gcc_checking_assert(EXPR)
Definition system.h:824
static ccp_prop_value_t * get_value(tree var)
Definition tree-ssa-ccp.cc:371
#define TREE_CODE(NODE)
Definition tree.h:325
#define TYPE_P(NODE)
Definition tree.h:227
#define TREE_TYPE(NODE)
Definition tree.h:513
Definition ipa-prop.h:181
struct ipa_load_agg_data load_agg
Definition ipa-prop.h:184
tree constant
Definition ipa-prop.h:182
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:183
Definition ipa-prop.h:351
struct ipa_ancestor_jf_data ancestor
Definition ipa-prop.h:354
struct ipa_constant_data constant
Definition ipa-prop.h:352
struct ipa_pass_through_data pass_through
Definition ipa-prop.h:353
#define FOR_EACH_VEC_SAFE_ELT(V, I, P)
Definition vec.h:1898
constexpr vnull vNULL
Definition vec.h:569
unsigned vec_safe_length(const vec< T, A, vl_embed > *v)
Definition vec.h:686
void vec_free(vec< T, A, vl_embed > *&v)
Definition vec.h:747
generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION > > widest_int
Definition wide-int.h:345