1 /* Interprocedural constant propagation
2 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
3 Free Software Foundation, Inc.
4 Contributed by Razya Ladelsky <RAZYA@il.ibm.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 /* Interprocedural constant propagation. The aim of interprocedural constant
23 propagation (IPCP) is to find which function's argument has the same
24 constant value in each invocation throughout the whole program. For example,
25 consider the following program:
29 printf ("value is %d",y);
49 The IPCP algorithm will find that g's formal argument y is always called
52 The algorithm used is based on "Interprocedural Constant Propagation", by
53 David Callahan, Keith D Cooper, Ken Kennedy, Linda Torczon, Comp86, pg
56 The optimization is divided into three stages:
58 First stage - intraprocedural analysis
59 =======================================
60 This phase computes jump_function and modification flags.
62 A jump function for a callsite represents the values passed as an actual
63 arguments of a given callsite. There are three types of values:
64 Pass through - the caller's formal parameter is passed as an actual argument.
65 Constant - a constant is passed as an actual argument.
66 Unknown - neither of the above.
68 The jump function info, ipa_jump_func, is stored in ipa_edge_args
69 structure (defined in ipa_prop.h and pointed to by cgraph_node->aux)
70 modified_flags are defined in ipa_node_params structure
71 (defined in ipa_prop.h and pointed to by cgraph_edge->aux).
73 -ipcp_generate_summary() is the first stage driver.
75 Second stage - interprocedural analysis
76 ========================================
77 This phase does the interprocedural constant propagation.
78 It computes lattices for all formal parameters in the program
79 and their value that may be:
81 BOTTOM - non constant.
82 CONSTANT - constant value.
84 Lattice describing a formal parameter p will have a constant value if all
85 callsites invoking this function have the same constant value passed to p.
87 The lattices are stored in ipcp_lattice which is itself in ipa_node_params
88 structure (defined in ipa_prop.h and pointed to by cgraph_edge->aux).
90 -ipcp_iterate_stage() is the second stage driver.
92 Third phase - transformation of function code
93 ============================================
94 Propagates the constant-valued formals into the function.
95 For each function whose parameters are constants, we create its clone.
97 Then we process the clone in two ways:
98 1. We insert an assignment statement 'parameter = const' at the beginning
99 of the cloned function.
100 2. For read-only parameters that do not live in memory, we replace all their
101 uses with the constant.
103 We also need to modify some callsites to call the cloned functions instead
104 of the original ones. For a callsite passing an argument found to be a
105 constant by IPCP, there are two different cases to handle:
106 1. A constant is passed as an argument. In this case the callsite in the
107 should be redirected to call the cloned callee.
108 2. A parameter (of the caller) passed as an argument (pass through
109 argument). In such cases both the caller and the callee have clones and
110 only the callsite in the cloned caller is redirected to call to the
113 This update is done in two steps: First all cloned functions are created
114 during a traversal of the call graph, during which all callsites are
115 redirected to call the cloned function. Then the callsites are traversed
116 and many calls redirected back to fit the description above.
118 -ipcp_insert_stage() is the third phase driver.
121 This pass also performs devirtualization - turns virtual calls into direct
122 ones if it can prove that all invocations of the function call the same
123 callee. This is achieved by building a list of all base types (actually,
124 their BINFOs) that individual parameters can have in an iterative matter
125 just like propagating scalar constants and then examining whether virtual
126 calls which take a parameter as their object fold to the same target for all
127 these types. If we cannot enumerate all types or there is a type which does
128 not have any BINFO associated with it, cannot_devirtualize of the associated
129 parameter descriptor is set which is an equivalent of BOTTOM lattice value
130 in standard IPA constant propagation.
135 #include "coretypes.h"
140 #include "ipa-prop.h"
141 #include "tree-flow.h"
142 #include "tree-pass.h"
145 #include "diagnostic.h"
146 #include "tree-pretty-print.h"
147 #include "tree-dump.h"
148 #include "tree-inline.h"
151 #include "ipa-inline.h"
153 /* Number of functions identified as candidates for cloning. When not cloning
154 we can simplify iterate stage not forcing it to go through the decision
155 on what is profitable and what not. */
156 static int n_cloning_candidates
;
158 /* Maximal count found in program. */
159 static gcov_type max_count
;
161 /* Cgraph nodes that has been completely replaced by cloning during iterate
162 * stage and will be removed after ipcp is finished. */
163 static bitmap dead_nodes
;
165 static void ipcp_print_profile_data (FILE *);
166 static void ipcp_function_scale_print (FILE *);
168 /* Get the original node field of ipa_node_params associated with node NODE. */
169 static inline struct cgraph_node
*
170 ipcp_get_orig_node (struct cgraph_node
*node
)
172 return IPA_NODE_REF (node
)->ipcp_orig_node
;
175 /* Return true if NODE describes a cloned/versioned function. */
177 ipcp_node_is_clone (struct cgraph_node
*node
)
179 return (ipcp_get_orig_node (node
) != NULL
);
182 /* Create ipa_node_params and its data structures for NEW_NODE. Set ORIG_NODE
183 as the ipcp_orig_node field in ipa_node_params. */
185 ipcp_init_cloned_node (struct cgraph_node
*orig_node
,
186 struct cgraph_node
*new_node
)
188 gcc_checking_assert (ipa_node_params_vector
189 && (VEC_length (ipa_node_params_t
,
190 ipa_node_params_vector
)
191 > (unsigned) cgraph_max_uid
));
192 gcc_checking_assert (IPA_NODE_REF (new_node
)->params
);
193 IPA_NODE_REF (new_node
)->ipcp_orig_node
= orig_node
;
196 /* Return scale for NODE. */
197 static inline gcov_type
198 ipcp_get_node_scale (struct cgraph_node
*node
)
200 return IPA_NODE_REF (node
)->count_scale
;
203 /* Set COUNT as scale for NODE. */
205 ipcp_set_node_scale (struct cgraph_node
*node
, gcov_type count
)
207 IPA_NODE_REF (node
)->count_scale
= count
;
210 /* Return whether LAT is a constant lattice. */
212 ipcp_lat_is_const (struct ipcp_lattice
*lat
)
214 if (lat
->type
== IPA_CONST_VALUE
)
220 /* Return whether LAT is a constant lattice that ipa-cp can actually insert
221 into the code (i.e. constants excluding member pointers and pointers). */
223 ipcp_lat_is_insertable (struct ipcp_lattice
*lat
)
225 return lat
->type
== IPA_CONST_VALUE
;
228 /* Return true if LAT1 and LAT2 are equal. */
230 ipcp_lats_are_equal (struct ipcp_lattice
*lat1
, struct ipcp_lattice
*lat2
)
232 gcc_assert (ipcp_lat_is_const (lat1
) && ipcp_lat_is_const (lat2
));
233 if (lat1
->type
!= lat2
->type
)
236 if (TREE_CODE (lat1
->constant
) == ADDR_EXPR
237 && TREE_CODE (lat2
->constant
) == ADDR_EXPR
238 && TREE_CODE (TREE_OPERAND (lat1
->constant
, 0)) == CONST_DECL
239 && TREE_CODE (TREE_OPERAND (lat2
->constant
, 0)) == CONST_DECL
)
240 return operand_equal_p (DECL_INITIAL (TREE_OPERAND (lat1
->constant
, 0)),
241 DECL_INITIAL (TREE_OPERAND (lat2
->constant
, 0)), 0);
243 return operand_equal_p (lat1
->constant
, lat2
->constant
, 0);
246 /* Compute Meet arithmetics:
247 Meet (IPA_BOTTOM, x) = IPA_BOTTOM
249 Meet (const_a,const_b) = IPA_BOTTOM, if const_a != const_b.
250 MEET (const_a,const_b) = const_a, if const_a == const_b.*/
252 ipa_lattice_meet (struct ipcp_lattice
*res
, struct ipcp_lattice
*lat1
,
253 struct ipcp_lattice
*lat2
)
255 if (lat1
->type
== IPA_BOTTOM
|| lat2
->type
== IPA_BOTTOM
)
257 res
->type
= IPA_BOTTOM
;
260 if (lat1
->type
== IPA_TOP
)
262 res
->type
= lat2
->type
;
263 res
->constant
= lat2
->constant
;
266 if (lat2
->type
== IPA_TOP
)
268 res
->type
= lat1
->type
;
269 res
->constant
= lat1
->constant
;
272 if (!ipcp_lats_are_equal (lat1
, lat2
))
274 res
->type
= IPA_BOTTOM
;
277 res
->type
= lat1
->type
;
278 res
->constant
= lat1
->constant
;
281 /* True when OLD_LAT and NEW_LAT values are not the same. */
284 ipcp_lattice_changed (struct ipcp_lattice
*old_lat
,
285 struct ipcp_lattice
*new_lat
)
287 if (old_lat
->type
== new_lat
->type
)
289 if (!ipcp_lat_is_const (old_lat
))
291 if (ipcp_lats_are_equal (old_lat
, new_lat
))
297 /* Print all ipcp_lattices of all functions to F. */
299 ipcp_print_all_lattices (FILE * f
)
301 struct cgraph_node
*node
;
304 fprintf (f
, "\nLattice:\n");
305 for (node
= cgraph_nodes
; node
; node
= node
->next
)
307 struct ipa_node_params
*info
;
311 info
= IPA_NODE_REF (node
);
312 fprintf (f
, " Node: %s:\n", cgraph_node_name (node
));
313 count
= ipa_get_param_count (info
);
314 for (i
= 0; i
< count
; i
++)
316 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
318 fprintf (f
, " param [%d]: ", i
);
319 if (lat
->type
== IPA_CONST_VALUE
)
321 tree cst
= lat
->constant
;
322 fprintf (f
, "type is CONST ");
323 print_generic_expr (f
, cst
, 0);
324 if (TREE_CODE (cst
) == ADDR_EXPR
325 && TREE_CODE (TREE_OPERAND (cst
, 0)) == CONST_DECL
)
328 print_generic_expr (f
, DECL_INITIAL (TREE_OPERAND (cst
, 0)),
332 else if (lat
->type
== IPA_TOP
)
333 fprintf (f
, "type is TOP");
335 fprintf (f
, "type is BOTTOM");
336 if (ipa_param_cannot_devirtualize_p (info
, i
))
337 fprintf (f
, " - cannot_devirtualize set\n");
338 else if (ipa_param_types_vec_empty (info
, i
))
339 fprintf (f
, " - type list empty\n");
346 /* Return true if ipcp algorithms would allow cloning NODE. */
349 ipcp_versionable_function_p (struct cgraph_node
*node
)
351 struct cgraph_edge
*edge
;
353 /* There are a number of generic reasons functions cannot be versioned. We
354 also cannot remove parameters if there are type attributes such as fnspec
356 if (!inline_summary (node
)->versionable
357 || TYPE_ATTRIBUTES (TREE_TYPE (node
->decl
)))
360 /* Removing arguments doesn't work if the function takes varargs
361 or use __builtin_apply_args. */
362 for (edge
= node
->callees
; edge
; edge
= edge
->next_callee
)
364 tree t
= edge
->callee
->decl
;
365 if (DECL_BUILT_IN_CLASS (t
) == BUILT_IN_NORMAL
366 && (DECL_FUNCTION_CODE (t
) == BUILT_IN_APPLY_ARGS
367 || DECL_FUNCTION_CODE (t
) == BUILT_IN_VA_START
))
374 /* Return true if this NODE is viable candidate for cloning. */
376 ipcp_cloning_candidate_p (struct cgraph_node
*node
)
380 gcov_type direct_call_sum
= 0;
381 struct cgraph_edge
*e
;
383 /* We never clone functions that are not visible from outside.
384 FIXME: in future we should clone such functions when they are called with
385 different constants, but current ipcp implementation is not good on this.
387 if (cgraph_only_called_directly_p (node
) || !node
->analyzed
)
390 /* When function address is taken, we are pretty sure it will be called in hidden way. */
391 if (node
->address_taken
)
394 fprintf (dump_file
, "Not considering %s for cloning; address is taken.\n",
395 cgraph_node_name (node
));
399 if (cgraph_function_body_availability (node
) <= AVAIL_OVERWRITABLE
)
402 fprintf (dump_file
, "Not considering %s for cloning; body is overwritable.\n",
403 cgraph_node_name (node
));
406 if (!ipcp_versionable_function_p (node
))
409 fprintf (dump_file
, "Not considering %s for cloning; body is not versionable.\n",
410 cgraph_node_name (node
));
413 for (e
= node
->callers
; e
; e
= e
->next_caller
)
415 direct_call_sum
+= e
->count
;
417 if (cgraph_maybe_hot_edge_p (e
))
424 fprintf (dump_file
, "Not considering %s for cloning; no direct calls.\n",
425 cgraph_node_name (node
));
428 if (inline_summary (node
)->self_size
< n_calls
)
431 fprintf (dump_file
, "Considering %s for cloning; code would shrink.\n",
432 cgraph_node_name (node
));
436 if (!flag_ipa_cp_clone
)
439 fprintf (dump_file
, "Not considering %s for cloning; -fipa-cp-clone disabled.\n",
440 cgraph_node_name (node
));
444 if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node
->decl
)))
447 fprintf (dump_file
, "Not considering %s for cloning; optimizing it for size.\n",
448 cgraph_node_name (node
));
452 /* When profile is available and function is hot, propagate into it even if
453 calls seems cold; constant propagation can improve function's speed
457 if (direct_call_sum
> node
->count
* 90 / 100)
460 fprintf (dump_file
, "Considering %s for cloning; usually called directly.\n",
461 cgraph_node_name (node
));
468 fprintf (dump_file
, "Not considering %s for cloning; no hot calls.\n",
469 cgraph_node_name (node
));
473 fprintf (dump_file
, "Considering %s for cloning.\n",
474 cgraph_node_name (node
));
478 /* Mark parameter with index I of function described by INFO as unsuitable for
479 devirtualization. Return true if it has already been marked so. */
482 ipa_set_param_cannot_devirtualize (struct ipa_node_params
*info
, int i
)
484 bool ret
= info
->params
[i
].cannot_devirtualize
;
485 info
->params
[i
].cannot_devirtualize
= true;
486 if (info
->params
[i
].types
)
487 VEC_free (tree
, heap
, info
->params
[i
].types
);
491 /* Initialize ipcp_lattices array. The lattices corresponding to supported
492 types (integers, real types and Fortran constants defined as const_decls)
493 are initialized to IPA_TOP, the rest of them to IPA_BOTTOM. */
495 ipcp_initialize_node_lattices (struct cgraph_node
*node
)
498 struct ipa_node_params
*info
= IPA_NODE_REF (node
);
499 enum ipa_lattice_type type
;
501 if (ipa_is_called_with_var_arguments (info
))
503 else if (node
->local
.local
)
505 /* When cloning is allowed, we can assume that externally visible functions
506 are not called. We will compensate this by cloning later. */
507 else if (ipcp_cloning_candidate_p (node
))
508 type
= IPA_TOP
, n_cloning_candidates
++;
512 for (i
= 0; i
< ipa_get_param_count (info
) ; i
++)
514 ipa_get_lattice (info
, i
)->type
= type
;
515 if (type
== IPA_BOTTOM
)
516 ipa_set_param_cannot_devirtualize (info
, i
);
520 /* Build a constant tree with type TREE_TYPE and value according to LAT.
521 Return the tree, or, if it is not possible to convert such value
522 to TREE_TYPE, NULL. */
524 build_const_val (struct ipcp_lattice
*lat
, tree tree_type
)
528 gcc_assert (ipcp_lat_is_const (lat
));
531 if (!useless_type_conversion_p (tree_type
, TREE_TYPE (val
)))
533 if (fold_convertible_p (tree_type
, val
))
534 return fold_build1 (NOP_EXPR
, tree_type
, val
);
535 else if (TYPE_SIZE (tree_type
) == TYPE_SIZE (TREE_TYPE (val
)))
536 return fold_build1 (VIEW_CONVERT_EXPR
, tree_type
, val
);
543 /* Compute the proper scale for NODE. It is the ratio between the number of
544 direct calls (represented on the incoming cgraph_edges) and sum of all
545 invocations of NODE (represented as count in cgraph_node).
547 FIXME: This code is wrong. Since the callers can be also clones and
548 the clones are not scaled yet, the sums gets unrealistically high.
549 To properly compute the counts, we would need to do propagation across
550 callgraph (as external call to A might imply call to non-cloned B
551 if A's clone calls cloned B). */
553 ipcp_compute_node_scale (struct cgraph_node
*node
)
556 struct cgraph_edge
*cs
;
559 /* Compute sum of all counts of callers. */
560 for (cs
= node
->callers
; cs
!= NULL
; cs
= cs
->next_caller
)
562 /* Work around the unrealistically high sum problem. We just don't want
563 the non-cloned body to have negative or very low frequency. Since
564 majority of execution time will be spent in clones anyway, this should
565 give good enough profile. */
566 if (sum
> node
->count
* 9 / 10)
567 sum
= node
->count
* 9 / 10;
568 if (node
->count
== 0)
569 ipcp_set_node_scale (node
, 0);
571 ipcp_set_node_scale (node
, sum
* REG_BR_PROB_BASE
/ node
->count
);
574 /* Return true if there are some formal parameters whose value is IPA_TOP (in
575 the whole compilation unit). Change their values to IPA_BOTTOM, since they
576 most probably get their values from outside of this compilation unit. */
578 ipcp_change_tops_to_bottom (void)
581 struct cgraph_node
*node
;
585 for (node
= cgraph_nodes
; node
; node
= node
->next
)
587 struct ipa_node_params
*info
= IPA_NODE_REF (node
);
588 count
= ipa_get_param_count (info
);
589 for (i
= 0; i
< count
; i
++)
591 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
592 if (lat
->type
== IPA_TOP
)
597 fprintf (dump_file
, "Forcing param ");
598 print_generic_expr (dump_file
, ipa_get_param (info
, i
), 0);
599 fprintf (dump_file
, " of node %s to bottom.\n",
600 cgraph_node_name (node
));
602 lat
->type
= IPA_BOTTOM
;
604 if (!ipa_param_cannot_devirtualize_p (info
, i
)
605 && ipa_param_types_vec_empty (info
, i
))
608 ipa_set_param_cannot_devirtualize (info
, i
);
611 fprintf (dump_file
, "Marking param ");
612 print_generic_expr (dump_file
, ipa_get_param (info
, i
), 0);
613 fprintf (dump_file
, " of node %s as unusable for "
614 "devirtualization.\n",
615 cgraph_node_name (node
));
623 /* Insert BINFO to the list of known types of parameter number I of the
624 function described by CALLEE_INFO. Return true iff the type information
625 associated with the callee parameter changed in any way. */
628 ipcp_add_param_type (struct ipa_node_params
*callee_info
, int i
, tree binfo
)
632 if (ipa_param_cannot_devirtualize_p (callee_info
, i
))
635 if (callee_info
->params
[i
].types
)
637 count
= VEC_length (tree
, callee_info
->params
[i
].types
);
638 for (j
= 0; j
< count
; j
++)
639 if (VEC_index (tree
, callee_info
->params
[i
].types
, j
) == binfo
)
643 if (VEC_length (tree
, callee_info
->params
[i
].types
)
644 == (unsigned) PARAM_VALUE (PARAM_DEVIRT_TYPE_LIST_SIZE
))
645 return !ipa_set_param_cannot_devirtualize (callee_info
, i
);
647 VEC_safe_push (tree
, heap
, callee_info
->params
[i
].types
, binfo
);
651 /* Copy known types information for parameter number CALLEE_IDX of CALLEE_INFO
652 from a parameter of CALLER_INFO as described by JF. Return true iff the
653 type information changed in any way. JF must be a pass-through or an
654 ancestor jump function. */
657 ipcp_copy_types (struct ipa_node_params
*caller_info
,
658 struct ipa_node_params
*callee_info
,
659 int callee_idx
, struct ipa_jump_func
*jf
)
661 int caller_idx
, j
, count
;
664 if (ipa_param_cannot_devirtualize_p (callee_info
, callee_idx
))
667 if (jf
->type
== IPA_JF_PASS_THROUGH
)
669 if (jf
->value
.pass_through
.operation
!= NOP_EXPR
)
671 ipa_set_param_cannot_devirtualize (callee_info
, callee_idx
);
674 caller_idx
= jf
->value
.pass_through
.formal_id
;
677 caller_idx
= jf
->value
.ancestor
.formal_id
;
679 if (ipa_param_cannot_devirtualize_p (caller_info
, caller_idx
))
681 ipa_set_param_cannot_devirtualize (callee_info
, callee_idx
);
685 if (!caller_info
->params
[caller_idx
].types
)
689 count
= VEC_length (tree
, caller_info
->params
[caller_idx
].types
);
690 for (j
= 0; j
< count
; j
++)
692 tree binfo
= VEC_index (tree
, caller_info
->params
[caller_idx
].types
, j
);
693 if (jf
->type
== IPA_JF_ANCESTOR
)
695 binfo
= get_binfo_at_offset (binfo
, jf
->value
.ancestor
.offset
,
696 jf
->value
.ancestor
.type
);
699 ipa_set_param_cannot_devirtualize (callee_info
, callee_idx
);
703 res
|= ipcp_add_param_type (callee_info
, callee_idx
, binfo
);
708 /* Propagate type information for parameter of CALLEE_INFO number I as
709 described by JF. CALLER_INFO describes the caller. Return true iff the
710 type information changed in any way. */
713 ipcp_propagate_types (struct ipa_node_params
*caller_info
,
714 struct ipa_node_params
*callee_info
,
715 struct ipa_jump_func
*jf
, int i
)
720 case IPA_JF_CONST_MEMBER_PTR
:
724 case IPA_JF_KNOWN_TYPE
:
725 return ipcp_add_param_type (callee_info
, i
, jf
->value
.base_binfo
);
727 case IPA_JF_PASS_THROUGH
:
728 case IPA_JF_ANCESTOR
:
729 return ipcp_copy_types (caller_info
, callee_info
, i
, jf
);
732 /* If we reach this we cannot use this parameter for devirtualization. */
733 return !ipa_set_param_cannot_devirtualize (callee_info
, i
);
736 /* Interprocedural analysis. The algorithm propagates constants from the
737 caller's parameters to the callee's arguments. */
739 ipcp_propagate_stage (void)
742 struct ipcp_lattice inc_lat
= { IPA_BOTTOM
, NULL
};
743 struct ipcp_lattice new_lat
= { IPA_BOTTOM
, NULL
};
744 struct ipcp_lattice
*dest_lat
;
745 struct cgraph_edge
*cs
;
746 struct ipa_jump_func
*jump_func
;
747 struct ipa_func_list
*wl
;
750 ipa_check_create_node_params ();
751 ipa_check_create_edge_args ();
753 /* Initialize worklist to contain all functions. */
754 wl
= ipa_init_func_list ();
757 struct cgraph_node
*node
= ipa_pop_func_from_list (&wl
);
758 struct ipa_node_params
*info
= IPA_NODE_REF (node
);
760 for (cs
= node
->callees
; cs
; cs
= cs
->next_callee
)
762 struct ipa_node_params
*callee_info
= IPA_NODE_REF (cs
->callee
);
763 struct ipa_edge_args
*args
= IPA_EDGE_REF (cs
);
765 if (ipa_is_called_with_var_arguments (callee_info
)
766 || !cs
->callee
->analyzed
767 || ipa_is_called_with_var_arguments (callee_info
))
770 count
= ipa_get_cs_argument_count (args
);
771 for (i
= 0; i
< count
; i
++)
773 jump_func
= ipa_get_ith_jump_func (args
, i
);
774 ipa_lattice_from_jfunc (info
, &inc_lat
, jump_func
);
775 dest_lat
= ipa_get_lattice (callee_info
, i
);
776 ipa_lattice_meet (&new_lat
, &inc_lat
, dest_lat
);
777 if (ipcp_lattice_changed (&new_lat
, dest_lat
))
779 dest_lat
->type
= new_lat
.type
;
780 dest_lat
->constant
= new_lat
.constant
;
781 ipa_push_func_to_list (&wl
, cs
->callee
);
784 if (ipcp_propagate_types (info
, callee_info
, jump_func
, i
))
785 ipa_push_func_to_list (&wl
, cs
->callee
);
791 /* Call the constant propagation algorithm and re-call it if necessary
792 (if there are undetermined values left). */
794 ipcp_iterate_stage (void)
796 struct cgraph_node
*node
;
797 n_cloning_candidates
= 0;
800 fprintf (dump_file
, "\nIPA iterate stage:\n\n");
803 ipa_update_after_lto_read ();
805 for (node
= cgraph_nodes
; node
; node
= node
->next
)
807 ipcp_initialize_node_lattices (node
);
808 ipcp_compute_node_scale (node
);
810 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
812 ipcp_print_all_lattices (dump_file
);
813 ipcp_function_scale_print (dump_file
);
816 ipcp_propagate_stage ();
817 if (ipcp_change_tops_to_bottom ())
818 /* Some lattices have changed from IPA_TOP to IPA_BOTTOM.
819 This change should be propagated. */
821 gcc_assert (n_cloning_candidates
);
822 ipcp_propagate_stage ();
826 fprintf (dump_file
, "\nIPA lattices after propagation:\n");
827 ipcp_print_all_lattices (dump_file
);
828 if (dump_flags
& TDF_DETAILS
)
829 ipcp_print_profile_data (dump_file
);
833 /* Check conditions to forbid constant insertion to function described by
836 ipcp_node_modifiable_p (struct cgraph_node
*node
)
838 /* Once we will be able to do in-place replacement, we can be more
840 return ipcp_versionable_function_p (node
);
843 /* Print count scale data structures. */
845 ipcp_function_scale_print (FILE * f
)
847 struct cgraph_node
*node
;
849 for (node
= cgraph_nodes
; node
; node
= node
->next
)
853 fprintf (f
, "printing scale for %s: ", cgraph_node_name (node
));
854 fprintf (f
, "value is " HOST_WIDE_INT_PRINT_DEC
855 " \n", (HOST_WIDE_INT
) ipcp_get_node_scale (node
));
859 /* Print counts of all cgraph nodes. */
861 ipcp_print_func_profile_counts (FILE * f
)
863 struct cgraph_node
*node
;
865 for (node
= cgraph_nodes
; node
; node
= node
->next
)
867 fprintf (f
, "function %s: ", cgraph_node_name (node
));
868 fprintf (f
, "count is " HOST_WIDE_INT_PRINT_DEC
869 " \n", (HOST_WIDE_INT
) node
->count
);
873 /* Print counts of all cgraph edges. */
875 ipcp_print_call_profile_counts (FILE * f
)
877 struct cgraph_node
*node
;
878 struct cgraph_edge
*cs
;
880 for (node
= cgraph_nodes
; node
; node
= node
->next
)
882 for (cs
= node
->callees
; cs
; cs
= cs
->next_callee
)
884 fprintf (f
, "%s -> %s ", cgraph_node_name (cs
->caller
),
885 cgraph_node_name (cs
->callee
));
886 fprintf (f
, "count is " HOST_WIDE_INT_PRINT_DEC
" \n",
887 (HOST_WIDE_INT
) cs
->count
);
892 /* Print profile info for all functions. */
894 ipcp_print_profile_data (FILE * f
)
896 fprintf (f
, "\nNODE COUNTS :\n");
897 ipcp_print_func_profile_counts (f
);
898 fprintf (f
, "\nCS COUNTS stage:\n");
899 ipcp_print_call_profile_counts (f
);
902 /* Build and initialize ipa_replace_map struct according to LAT. This struct is
903 processed by versioning, which operates according to the flags set.
904 PARM_TREE is the formal parameter found to be constant. LAT represents the
906 static struct ipa_replace_map
*
907 ipcp_create_replace_map (tree parm_tree
, struct ipcp_lattice
*lat
)
909 struct ipa_replace_map
*replace_map
;
912 const_val
= build_const_val (lat
, TREE_TYPE (parm_tree
));
913 if (const_val
== NULL_TREE
)
917 fprintf (dump_file
, " const ");
918 print_generic_expr (dump_file
, lat
->constant
, 0);
919 fprintf (dump_file
, " can't be converted to param ");
920 print_generic_expr (dump_file
, parm_tree
, 0);
921 fprintf (dump_file
, "\n");
925 replace_map
= ggc_alloc_ipa_replace_map ();
928 fprintf (dump_file
, " replacing param ");
929 print_generic_expr (dump_file
, parm_tree
, 0);
930 fprintf (dump_file
, " with const ");
931 print_generic_expr (dump_file
, const_val
, 0);
932 fprintf (dump_file
, "\n");
934 replace_map
->old_tree
= parm_tree
;
935 replace_map
->new_tree
= const_val
;
936 replace_map
->replace_p
= true;
937 replace_map
->ref_p
= false;
942 /* Return true if this callsite should be redirected to the original callee
943 (instead of the cloned one). */
945 ipcp_need_redirect_p (struct cgraph_edge
*cs
)
947 struct ipa_node_params
*orig_callee_info
;
949 struct cgraph_node
*node
= cs
->callee
, *orig
;
951 if (!n_cloning_candidates
)
954 /* We can't redirect anything in thunks, yet. */
955 if (cs
->caller
->thunk
.thunk_p
)
958 if ((orig
= ipcp_get_orig_node (node
)) != NULL
)
960 if (ipcp_get_orig_node (cs
->caller
))
963 orig_callee_info
= IPA_NODE_REF (node
);
964 count
= ipa_get_param_count (orig_callee_info
);
965 for (i
= 0; i
< count
; i
++)
967 struct ipcp_lattice
*lat
= ipa_get_lattice (orig_callee_info
, i
);
968 struct ipa_jump_func
*jump_func
;
970 jump_func
= ipa_get_ith_jump_func (IPA_EDGE_REF (cs
), i
);
971 if ((ipcp_lat_is_const (lat
)
972 && jump_func
->type
!= IPA_JF_CONST
)
973 || (!ipa_param_cannot_devirtualize_p (orig_callee_info
, i
)
974 && !ipa_param_types_vec_empty (orig_callee_info
, i
)
975 && jump_func
->type
!= IPA_JF_CONST
976 && jump_func
->type
!= IPA_JF_KNOWN_TYPE
))
983 /* Fix the callsites and the call graph after function cloning was done. */
985 ipcp_update_callgraph (void)
987 struct cgraph_node
*node
;
989 for (node
= cgraph_nodes
; node
; node
= node
->next
)
990 if (node
->analyzed
&& ipcp_node_is_clone (node
))
992 bitmap args_to_skip
= NULL
;
993 struct cgraph_node
*orig_node
= ipcp_get_orig_node (node
);
994 struct ipa_node_params
*info
= IPA_NODE_REF (orig_node
);
995 int i
, count
= ipa_get_param_count (info
);
996 struct cgraph_edge
*cs
, *next
;
998 if (node
->local
.can_change_signature
)
1000 args_to_skip
= BITMAP_ALLOC (NULL
);
1001 for (i
= 0; i
< count
; i
++)
1003 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
1005 /* We can proactively remove obviously unused arguments. */
1006 if (!ipa_is_param_used (info
, i
))
1008 bitmap_set_bit (args_to_skip
, i
);
1012 if (lat
->type
== IPA_CONST_VALUE
)
1013 bitmap_set_bit (args_to_skip
, i
);
1016 for (cs
= node
->callers
; cs
; cs
= next
)
1018 next
= cs
->next_caller
;
1019 if (!ipcp_node_is_clone (cs
->caller
) && ipcp_need_redirect_p (cs
))
1022 fprintf (dump_file
, "Redirecting edge %s/%i -> %s/%i "
1024 cgraph_node_name (cs
->caller
), cs
->caller
->uid
,
1025 cgraph_node_name (cs
->callee
), cs
->callee
->uid
,
1026 cgraph_node_name (orig_node
), orig_node
->uid
);
1027 cgraph_redirect_edge_callee (cs
, orig_node
);
1033 /* Update profiling info for versioned functions and the functions they were
1036 ipcp_update_profiling (void)
1038 struct cgraph_node
*node
, *orig_node
;
1039 gcov_type scale
, scale_complement
;
1040 struct cgraph_edge
*cs
;
1042 for (node
= cgraph_nodes
; node
; node
= node
->next
)
1044 if (ipcp_node_is_clone (node
))
1046 orig_node
= ipcp_get_orig_node (node
);
1047 scale
= ipcp_get_node_scale (orig_node
);
1048 node
->count
= orig_node
->count
* scale
/ REG_BR_PROB_BASE
;
1049 scale_complement
= REG_BR_PROB_BASE
- scale
;
1051 gcc_assert (scale_complement
>= 0);
1053 orig_node
->count
* scale_complement
/ REG_BR_PROB_BASE
;
1054 for (cs
= node
->callees
; cs
; cs
= cs
->next_callee
)
1055 cs
->count
= cs
->count
* scale
/ REG_BR_PROB_BASE
;
1056 for (cs
= orig_node
->callees
; cs
; cs
= cs
->next_callee
)
1057 cs
->count
= cs
->count
* scale_complement
/ REG_BR_PROB_BASE
;
1062 /* If NODE was cloned, how much would program grow? */
1064 ipcp_estimate_growth (struct cgraph_node
*node
)
1066 struct cgraph_edge
*cs
;
1067 int redirectable_node_callers
= 0;
1068 int removable_args
= 0;
1070 = !cgraph_will_be_removed_from_program_if_no_direct_calls (node
);
1071 struct ipa_node_params
*info
;
1075 for (cs
= node
->callers
; cs
!= NULL
; cs
= cs
->next_caller
)
1076 if (cs
->caller
== node
|| !ipcp_need_redirect_p (cs
))
1077 redirectable_node_callers
++;
1079 need_original
= true;
1081 /* If we will be able to fully replace original node, we never increase
1086 info
= IPA_NODE_REF (node
);
1087 count
= ipa_get_param_count (info
);
1088 if (node
->local
.can_change_signature
)
1089 for (i
= 0; i
< count
; i
++)
1091 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
1093 /* We can proactively remove obviously unused arguments. */
1094 if (!ipa_is_param_used (info
, i
))
1097 if (lat
->type
== IPA_CONST_VALUE
)
1101 /* We make just very simple estimate of savings for removal of operand from
1102 call site. Precise cost is difficult to get, as our size metric counts
1103 constants and moves as free. Generally we are looking for cases that
1104 small function is called very many times. */
1105 estimate_ipcp_clone_size_and_time (node
, &growth
, NULL
);
1107 - removable_args
* redirectable_node_callers
;
1114 /* Estimate cost of cloning NODE. */
1116 ipcp_estimate_cloning_cost (struct cgraph_node
*node
)
1119 gcov_type count_sum
= 1;
1120 struct cgraph_edge
*e
;
1123 cost
= ipcp_estimate_growth (node
) * 1000;
1127 fprintf (dump_file
, "Versioning of %s will save code size\n",
1128 cgraph_node_name (node
));
1132 for (e
= node
->callers
; e
; e
= e
->next_caller
)
1133 if (!bitmap_bit_p (dead_nodes
, e
->caller
->uid
)
1134 && !ipcp_need_redirect_p (e
))
1136 count_sum
+= e
->count
;
1137 freq_sum
+= e
->frequency
+ 1;
1141 cost
/= count_sum
* 1000 / max_count
+ 1;
1143 cost
/= freq_sum
* 1000 / REG_BR_PROB_BASE
+ 1;
1145 fprintf (dump_file
, "Cost of versioning %s is %i, (size: %i, freq: %i)\n",
1146 cgraph_node_name (node
), cost
, inline_summary (node
)->self_size
,
1151 /* Walk indirect calls of NODE and if any polymorphic can be turned into a
1152 direct one now, do so. */
1155 ipcp_process_devirtualization_opportunities (struct cgraph_node
*node
)
1157 struct ipa_node_params
*info
= IPA_NODE_REF (node
);
1158 struct cgraph_edge
*ie
, *next_ie
;
1160 for (ie
= node
->indirect_calls
; ie
; ie
= next_ie
)
1163 HOST_WIDE_INT token
, anc_offset
;
1164 tree target
, delta
, otr_type
;
1165 struct ipcp_lattice
*lat
;
1167 next_ie
= ie
->next_callee
;
1168 if (!ie
->indirect_info
->polymorphic
)
1170 param_index
= ie
->indirect_info
->param_index
;
1171 if (param_index
== -1)
1174 lat
= ipa_get_lattice (info
, param_index
);
1175 token
= ie
->indirect_info
->otr_token
;
1176 anc_offset
= ie
->indirect_info
->anc_offset
;
1177 otr_type
= ie
->indirect_info
->otr_type
;
1179 if (lat
->type
== IPA_CONST_VALUE
)
1181 tree binfo
= gimple_extract_devirt_binfo_from_cst (lat
->constant
);
1184 binfo
= get_binfo_at_offset (binfo
, anc_offset
, otr_type
);
1187 target
= gimple_get_virt_method_for_binfo (token
, binfo
, &delta
,
1194 if (ipa_param_cannot_devirtualize_p (info
, param_index
)
1195 || ipa_param_types_vec_empty (info
, param_index
))
1198 types_count
= VEC_length (tree
, info
->params
[param_index
].types
);
1199 for (j
= 0; j
< types_count
; j
++)
1201 tree binfo
= VEC_index (tree
, info
->params
[param_index
].types
, j
);
1204 binfo
= get_binfo_at_offset (binfo
, anc_offset
, otr_type
);
1211 t
= gimple_get_virt_method_for_binfo (token
, binfo
, &d
, true);
1222 else if (target
!= t
|| !tree_int_cst_equal (delta
, d
))
1231 ipa_make_edge_direct_to_target (ie
, target
, delta
);
1235 /* Return number of live constant parameters. */
1237 ipcp_const_param_count (struct cgraph_node
*node
)
1239 int const_param
= 0;
1240 struct ipa_node_params
*info
= IPA_NODE_REF (node
);
1241 int count
= ipa_get_param_count (info
);
1244 for (i
= 0; i
< count
; i
++)
1246 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
1247 if ((ipcp_lat_is_insertable (lat
)
1248 /* Do not count obviously unused arguments. */
1249 && ipa_is_param_used (info
, i
))
1250 || (!ipa_param_cannot_devirtualize_p (info
, i
)
1251 && !ipa_param_types_vec_empty (info
, i
)))
1257 /* Given that a formal parameter of NODE given by INDEX is known to be constant
1258 CST, try to find any indirect edges that can be made direct and make them
1259 so. Note that INDEX is the number the parameter at the time of analyzing
1260 parameter uses and parameter removals should not be considered for it. (In
1261 fact, the parameter itself has just been removed.) */
1264 ipcp_discover_new_direct_edges (struct cgraph_node
*node
, int index
, tree cst
)
1266 struct cgraph_edge
*ie
, *next_ie
;
1268 for (ie
= node
->indirect_calls
; ie
; ie
= next_ie
)
1270 struct cgraph_indirect_call_info
*ici
= ie
->indirect_info
;
1272 next_ie
= ie
->next_callee
;
1273 if (ici
->param_index
!= index
1274 || ici
->polymorphic
)
1277 ipa_make_edge_direct_to_target (ie
, cst
, NULL_TREE
);
1282 /* Propagate the constant parameters found by ipcp_iterate_stage()
1283 to the function's code. */
1285 ipcp_insert_stage (void)
1287 struct cgraph_node
*node
, *node1
= NULL
;
1289 VEC (cgraph_edge_p
, heap
) * redirect_callers
;
1290 VEC (ipa_replace_map_p
,gc
)* replace_trees
;
1291 int node_callers
, count
;
1293 struct ipa_replace_map
*replace_param
;
1295 long overall_size
= 0, new_size
= 0;
1298 ipa_check_create_node_params ();
1299 ipa_check_create_edge_args ();
1301 fprintf (dump_file
, "\nIPA insert stage:\n\n");
1303 dead_nodes
= BITMAP_ALLOC (NULL
);
1305 for (node
= cgraph_nodes
; node
; node
= node
->next
)
1308 if (node
->count
> max_count
)
1309 max_count
= node
->count
;
1310 overall_size
+= inline_summary (node
)->self_size
;
1313 max_new_size
= overall_size
;
1314 if (max_new_size
< PARAM_VALUE (PARAM_LARGE_UNIT_INSNS
))
1315 max_new_size
= PARAM_VALUE (PARAM_LARGE_UNIT_INSNS
);
1316 max_new_size
= max_new_size
* PARAM_VALUE (PARAM_IPCP_UNIT_GROWTH
) / 100 + 1;
1318 /* First collect all functions we proved to have constant arguments to
1320 heap
= fibheap_new ();
1321 for (node
= cgraph_nodes
; node
; node
= node
->next
)
1323 struct ipa_node_params
*info
;
1324 /* Propagation of the constant is forbidden in certain conditions. */
1325 if (!node
->analyzed
|| !ipcp_node_modifiable_p (node
))
1327 info
= IPA_NODE_REF (node
);
1328 if (ipa_is_called_with_var_arguments (info
))
1330 if (ipcp_const_param_count (node
))
1331 node
->aux
= fibheap_insert (heap
, ipcp_estimate_cloning_cost (node
),
1335 /* Now clone in priority order until code size growth limits are met or
1337 while (!fibheap_empty (heap
))
1339 struct ipa_node_params
*info
;
1341 bitmap args_to_skip
;
1342 struct cgraph_edge
*cs
;
1344 node
= (struct cgraph_node
*)fibheap_extract_min (heap
);
1347 fprintf (dump_file
, "considering function %s\n",
1348 cgraph_node_name (node
));
1350 growth
= ipcp_estimate_growth (node
);
1352 if (new_size
+ growth
> max_new_size
)
1355 && cgraph_optimize_for_size_p (node
))
1358 fprintf (dump_file
, "Not versioning, cold code would grow");
1362 info
= IPA_NODE_REF (node
);
1363 count
= ipa_get_param_count (info
);
1365 replace_trees
= VEC_alloc (ipa_replace_map_p
, gc
, 1);
1367 if (node
->local
.can_change_signature
)
1368 args_to_skip
= BITMAP_GGC_ALLOC ();
1370 args_to_skip
= NULL
;
1371 for (i
= 0; i
< count
; i
++)
1373 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
1374 parm_tree
= ipa_get_param (info
, i
);
1376 /* We can proactively remove obviously unused arguments. */
1377 if (!ipa_is_param_used (info
, i
))
1380 bitmap_set_bit (args_to_skip
, i
);
1384 if (lat
->type
== IPA_CONST_VALUE
)
1387 ipcp_create_replace_map (parm_tree
, lat
);
1388 if (replace_param
== NULL
)
1390 VEC_safe_push (ipa_replace_map_p
, gc
, replace_trees
, replace_param
);
1392 bitmap_set_bit (args_to_skip
, i
);
1398 fprintf (dump_file
, "Not versioning, some parameters couldn't be replaced");
1404 /* Look if original function becomes dead after cloning. */
1405 for (cs
= node
->callers
; cs
!= NULL
; cs
= cs
->next_caller
)
1406 if (cs
->caller
== node
|| ipcp_need_redirect_p (cs
))
1408 if (!cs
&& cgraph_will_be_removed_from_program_if_no_direct_calls (node
))
1409 bitmap_set_bit (dead_nodes
, node
->uid
);
1411 /* Compute how many callers node has. */
1413 for (cs
= node
->callers
; cs
!= NULL
; cs
= cs
->next_caller
)
1415 redirect_callers
= VEC_alloc (cgraph_edge_p
, heap
, node_callers
);
1416 for (cs
= node
->callers
; cs
!= NULL
; cs
= cs
->next_caller
)
1417 if (!cs
->indirect_inlining_edge
)
1418 VEC_quick_push (cgraph_edge_p
, redirect_callers
, cs
);
1420 /* Redirecting all the callers of the node to the
1421 new versioned node. */
1423 cgraph_create_virtual_clone (node
, redirect_callers
, replace_trees
,
1424 args_to_skip
, "constprop");
1425 args_to_skip
= NULL
;
1426 VEC_free (cgraph_edge_p
, heap
, redirect_callers
);
1427 replace_trees
= NULL
;
1431 ipcp_process_devirtualization_opportunities (node1
);
1434 fprintf (dump_file
, "versioned function %s with growth %i, overall %i\n",
1435 cgraph_node_name (node
), (int)growth
, (int)new_size
);
1436 ipcp_init_cloned_node (node
, node1
);
1438 info
= IPA_NODE_REF (node
);
1439 for (i
= 0; i
< count
; i
++)
1441 struct ipcp_lattice
*lat
= ipa_get_lattice (info
, i
);
1442 if (lat
->type
== IPA_CONST_VALUE
)
1443 ipcp_discover_new_direct_edges (node1
, i
, lat
->constant
);
1447 dump_function_to_file (node1
->decl
, dump_file
, dump_flags
);
1449 for (cs
= node
->callees
; cs
; cs
= cs
->next_callee
)
1450 if (cs
->callee
->aux
)
1452 fibheap_delete_node (heap
, (fibnode_t
) cs
->callee
->aux
);
1453 cs
->callee
->aux
= fibheap_insert (heap
,
1454 ipcp_estimate_cloning_cost (cs
->callee
),
1459 while (!fibheap_empty (heap
))
1462 fprintf (dump_file
, "skipping function %s\n",
1463 cgraph_node_name (node
));
1464 node
= (struct cgraph_node
*) fibheap_extract_min (heap
);
1467 fibheap_delete (heap
);
1468 BITMAP_FREE (dead_nodes
);
1469 ipcp_update_callgraph ();
1470 ipcp_update_profiling ();
1473 /* The IPCP driver. */
1477 cgraph_remove_unreachable_nodes (true,dump_file
);
1480 fprintf (dump_file
, "\nIPA structures before propagation:\n");
1481 if (dump_flags
& TDF_DETAILS
)
1482 ipa_print_all_params (dump_file
);
1483 ipa_print_all_jump_functions (dump_file
);
1485 ipa_check_create_node_params ();
1486 ipa_check_create_edge_args ();
1487 /* 2. Do the interprocedural propagation. */
1488 ipcp_iterate_stage ();
1489 /* 3. Insert the constants found to the functions. */
1490 ipcp_insert_stage ();
1491 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
1493 fprintf (dump_file
, "\nProfiling info after insert stage:\n");
1494 ipcp_print_profile_data (dump_file
);
1496 /* Free all IPCP structures. */
1497 ipa_free_all_structures_after_ipa_cp ();
1499 fprintf (dump_file
, "\nIPA constant propagation end\n");
1503 /* Initialization and computation of IPCP data structures. This is the initial
1504 intraprocedural analysis of functions, which gathers information to be
1505 propagated later on. */
1508 ipcp_generate_summary (void)
1510 struct cgraph_node
*node
;
1513 fprintf (dump_file
, "\nIPA constant propagation start:\n");
1514 ipa_register_cgraph_hooks ();
1516 /* FIXME: We could propagate through thunks happily and we could be
1517 even able to clone them, if needed. Do that later. */
1518 FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node
)
1520 /* Unreachable nodes should have been eliminated before ipcp. */
1521 gcc_assert (node
->needed
|| node
->reachable
);
1523 inline_summary (node
)->versionable
= tree_versionable_function_p (node
->decl
);
1524 ipa_analyze_node (node
);
1528 /* Write ipcp summary for nodes in SET. */
1530 ipcp_write_summary (cgraph_node_set set
,
1531 varpool_node_set vset ATTRIBUTE_UNUSED
)
1533 ipa_prop_write_jump_functions (set
);
1536 /* Read ipcp summary. */
1538 ipcp_read_summary (void)
1540 ipa_prop_read_jump_functions ();
1543 /* Gate for IPCP optimization. */
1545 cgraph_gate_cp (void)
1547 /* FIXME: We should remove the optimize check after we ensure we never run
1548 IPA passes when not optimizing. */
1549 return flag_ipa_cp
&& optimize
;
1552 struct ipa_opt_pass_d pass_ipa_cp
=
1557 cgraph_gate_cp
, /* gate */
1558 ipcp_driver
, /* execute */
1561 0, /* static_pass_number */
1562 TV_IPA_CONSTANT_PROP
, /* tv_id */
1563 0, /* properties_required */
1564 0, /* properties_provided */
1565 0, /* properties_destroyed */
1566 0, /* todo_flags_start */
1567 TODO_dump_cgraph
| TODO_dump_func
|
1568 TODO_remove_functions
| TODO_ggc_collect
/* todo_flags_finish */
1570 ipcp_generate_summary
, /* generate_summary */
1571 ipcp_write_summary
, /* write_summary */
1572 ipcp_read_summary
, /* read_summary */
1573 NULL
, /* write_optimization_summary */
1574 NULL
, /* read_optimization_summary */
1575 NULL
, /* stmt_fixup */
1577 NULL
, /* function_transform */
1578 NULL
, /* variable_transform */