1 /* Inlining decision heuristics.
2 Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011
3 Free Software Foundation, Inc.
4 Contributed by Jan Hubicka
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 /* Analysis used by the inliner and other passes limiting code size growth.
24 We estimate for each function
26 - average function execution time
27 - inlining size benefit (that is how much of function body size
28 and its call sequence is expected to disappear by inlining)
29 - inlining time benefit
32 - call statement size and time
34 inlinie_summary datastructures store above information locally (i.e.
35 parameters of the function itself) and globally (i.e. parameters of
36 the function created by applying all the inline decisions already
37 present in the callgraph).
39 We provide accestor to the inline_summary datastructure and
40 basic logic updating the parameters when inlining is performed.
42 The summaries are context sensitive. Context means
43 1) partial assignment of known constant values of operands
44 2) whether function is inlined into the call or not.
45 It is easy to add more variants. To represent function size and time
46 that depends on context (i.e. it is known to be optimized away when
47 context is known either by inlining or from IP-CP and clonning),
48 we use predicates. Predicates are logical formulas in
49 conjunctive-disjunctive form consisting of clauses. Clauses are bitmaps
50 specifying what conditions must be true. Conditions are simple test
51 of the form described above.
53 In order to make predicate (possibly) true, all of its clauses must
54 be (possibly) true. To make clause (possibly) true, one of conditions
55 it mentions must be (possibly) true. There are fixed bounds on
56 number of clauses and conditions and all the manipulation functions
57 are conservative in positive direction. I.e. we may lose precision
58 by thinking that predicate may be true even when it is not.
60 estimate_edge_size and estimate_edge_growth can be used to query
61 function size/time in the given context. inline_merge_summary merges
62 properties of caller and callee after inlining.
64 Finally pass_inline_parameters is exported. This is used to drive
65 computation of function parameters used by the early inliner. IPA
66 inlined performs analysis via its analyze_function method. */
70 #include "coretypes.h"
73 #include "tree-inline.h"
74 #include "langhooks.h"
77 #include "diagnostic.h"
78 #include "gimple-pretty-print.h"
81 #include "tree-pass.h"
84 #include "tree-flow.h"
86 #include "lto-streamer.h"
87 #include "ipa-inline.h"
89 /* Estimate runtime of function can easilly run into huge numbers with many
90 nested loops. Be sure we can compute time * INLINE_SIZE_SCALE in integer.
91 For anything larger we use gcov_type. */
92 #define MAX_TIME 1000000
94 /* Number of bits in integer, but we really want to be stable across different
96 #define NUM_CONDITIONS 32
98 enum predicate_conditions
100 predicate_false_condition = 0,
101 predicate_not_inlined_condition = 1,
102 predicate_first_dynamic_condition = 2
105 /* Special condition code we use to represent test that operand is compile time
107 #define IS_NOT_CONSTANT ERROR_MARK
109 /* Holders of ipa cgraph hooks: */
110 static struct cgraph_node_hook_list *function_insertion_hook_holder;
111 static struct cgraph_node_hook_list *node_removal_hook_holder;
112 static struct cgraph_2node_hook_list *node_duplication_hook_holder;
113 static struct cgraph_edge_hook_list *edge_removal_hook_holder;
114 static void inline_node_removal_hook (struct cgraph_node *, void *);
115 static void inline_node_duplication_hook (struct cgraph_node *,
116 struct cgraph_node *, void *);
118 /* VECtor holding inline summaries.
119 In GGC memory because conditions might point to constant trees. */
120 VEC(inline_summary_t,gc) *inline_summary_vec;
122 /* Cached node/edge growths. */
123 VEC(int,heap) *node_growth_cache;
124 VEC(edge_growth_cache_entry,heap) *edge_growth_cache;
127 /* Return true predicate (tautology).
128 We represent it by empty list of clauses. */
130 static inline struct predicate
131 true_predicate (void)
139 /* Return predicate testing single condition number COND. */
141 static inline struct predicate
142 single_cond_predicate (int cond)
145 p.clause[0]=1 << cond;
151 /* Return false predicate. First clause require false condition. */
153 static inline struct predicate
154 false_predicate (void)
156 return single_cond_predicate (predicate_false_condition);
160 /* Return predicate that is set true when function is not inlined. */
161 static inline struct predicate
162 not_inlined_predicate (void)
164 return single_cond_predicate (predicate_not_inlined_condition);
168 /* Add condition to condition list CONDS. */
170 static struct predicate
171 add_condition (struct inline_summary *summary, int operand_num,
172 enum tree_code code, tree val)
176 struct condition new_cond;
178 for (i = 0; VEC_iterate (condition, summary->conds, i, c); i++)
180 if (c->operand_num == operand_num
183 return single_cond_predicate (i + predicate_first_dynamic_condition);
185 /* Too many conditions. Give up and return constant true. */
186 if (i == NUM_CONDITIONS - predicate_first_dynamic_condition)
187 return true_predicate ();
189 new_cond.operand_num = operand_num;
190 new_cond.code = code;
192 VEC_safe_push (condition, gc, summary->conds, &new_cond);
193 return single_cond_predicate (i + predicate_first_dynamic_condition);
197 /* Add clause CLAUSE into the predicate. */
200 add_clause (struct predicate *p, clause_t clause)
208 /* Flase clause makes the whole predicate false. Kill the other variants. */
209 if (clause & (1 << predicate_false_condition))
211 p->clause[0] = (1 << predicate_false_condition);
214 for (i = 0; i < MAX_CLAUSES; i++)
216 if (p->clause[i] == clause)
220 if (p->clause[i] < clause && !insert_here)
223 /* We run out of variants. Be conservative in positive direciton. */
224 if (i == MAX_CLAUSES)
226 /* Keep clauses ordered by index, so equivalence testing is easy. */
227 p->clause[i + 1] = 0;
228 for (;i > insert_here; i--)
229 p->clause[i] = p->clause[i - 1];
230 p->clause[insert_here] = clause;
236 static struct predicate
237 and_predicates (struct predicate *p, struct predicate *p2)
239 struct predicate out = *p;
241 for (i = 0; p2->clause[i]; i++)
242 add_clause (&out, p2->clause[i]);
249 static struct predicate
250 or_predicates (struct predicate *p, struct predicate *p2)
252 struct predicate out = true_predicate ();
254 /* If one of conditions is false, return the other. */
255 if (p2->clause[0] == 1 << predicate_false_condition)
257 gcc_checking_assert (!p2->clause[1]);
260 if (p->clause[0] == 1 << predicate_false_condition)
262 gcc_checking_assert (!p->clause[1]);
265 for (i = 0; p->clause[i]; i++)
266 for (j = 0; p2->clause[j]; j++)
267 add_clause (&out, p->clause[i] | p2->clause[j]);
272 /* Return true if predicates are obviously equal. */
275 predicates_equal_p (struct predicate *p, struct predicate *p2)
278 for (i = 0; p->clause[i]; i++)
279 if (p->clause[i] != p2->clause[i])
281 return !p2->clause[i];
285 /* Having partial truth assignment in POSSIBLE_TRUTHS, return false if predicate P
289 evaulate_predicate (struct predicate *p, clause_t possible_truths)
293 /* True remains true. */
297 /* See if we can find clause we can disprove. */
298 for (i = 0; p->clause[i]; i++)
299 if (!(p->clause[i] & possible_truths))
305 /* Dump conditional COND. */
308 dump_condition (FILE *f, conditions conditions, int cond)
311 if (cond == predicate_false_condition)
312 fprintf (f, "false");
313 else if (cond == predicate_not_inlined_condition)
314 fprintf (f, "not inlined");
317 c = VEC_index (condition, conditions, cond - predicate_first_dynamic_condition);
318 fprintf (f, "op%i", c->operand_num);
319 if (c->code == IS_NOT_CONSTANT)
321 fprintf (f, " not constant");
324 fprintf (f, " %s ", op_symbol_code (c->code));
325 print_generic_expr (f, c->val, 1);
330 /* Dump clause CLAUSE. */
333 dump_clause (FILE *f, conditions conds, clause_t clause)
340 for (i = 0; i < NUM_CONDITIONS; i++)
341 if (clause & (1 << i))
346 dump_condition (f, conds, i);
352 /* Dump predicate PREDICATE. */
355 dump_predicate (FILE *f, conditions conds, struct predicate *pred)
358 if (!pred->clause[0])
359 dump_clause (f, conds, 0);
361 for (i = 0; pred->clause[i]; i++)
365 dump_clause (f, conds, pred->clause[i]);
371 /* Record SIZE and TIME under condition PRED into the inline summary. */
374 account_size_time (struct inline_summary *summary, int size, int time, struct predicate *pred)
380 if (pred->clause[0] == (1 << predicate_false_condition))
383 /* We need to create initial empty unconitional clause, but otherwie
384 we don't need to account empty times and sizes. */
385 if (!size && !time && summary->conds)
388 /* Watch overflow that might result from insane profiles. */
389 if (time > MAX_TIME * INLINE_TIME_SCALE)
390 time = MAX_TIME * INLINE_TIME_SCALE;
391 gcc_assert (time >= 0);
393 for (i = 0; VEC_iterate (size_time_entry, summary->entry, i, e); i++)
394 if (predicates_equal_p (&e->predicate, pred))
403 e = VEC_index (size_time_entry, summary->entry, 0);
404 gcc_assert (!e->predicate.clause[0]);
406 if (dump_file && (dump_flags & TDF_DETAILS) && (time || size))
408 fprintf (dump_file, "\t\tAccounting size:%3.2f, time:%3.2f on %spredicate:",
409 ((double)size) / INLINE_SIZE_SCALE, ((double)time) / INLINE_TIME_SCALE,
410 found ? "" : "new ");
411 dump_predicate (dump_file, summary->conds, pred);
415 struct size_time_entry new_entry;
416 new_entry.size = size;
417 new_entry.time = time;
418 new_entry.predicate = *pred;
419 VEC_safe_push (size_time_entry, gc, summary->entry, &new_entry);
425 if (e->time > MAX_TIME * INLINE_TIME_SCALE)
426 e->time = MAX_TIME * INLINE_TIME_SCALE;
431 /* Work out what conditions might be true at invocation of E. */
434 evaulate_conditions_for_edge (struct cgraph_edge *e, bool inline_p)
436 clause_t clause = inline_p ? 0 : 1 << predicate_not_inlined_condition;
437 struct inline_summary *info = inline_summary (e->callee);
440 if (ipa_node_params_vector && info->conds
441 /* FIXME: it seems that we forget to get argument count in some cases,
442 probaby for previously indirect edges or so. */
443 && ipa_get_cs_argument_count (IPA_EDGE_REF (e)))
445 struct ipa_node_params *parms_info;
446 struct ipa_edge_args *args = IPA_EDGE_REF (e);
447 int i, count = ipa_get_cs_argument_count (args);
448 struct ipcp_lattice lat;
450 VEC (tree, heap) *known_vals = NULL;
452 if (e->caller->global.inlined_to)
453 parms_info = IPA_NODE_REF (e->caller->global.inlined_to);
455 parms_info = IPA_NODE_REF (e->caller);
457 VEC_safe_grow_cleared (tree, heap, known_vals, count);
458 for (i = 0; i < count; i++)
460 ipa_lattice_from_jfunc (parms_info, &lat, ipa_get_ith_jump_func (args, i));
461 if (lat.type == IPA_CONST_VALUE)
462 VEC_replace (tree, known_vals, i, lat.constant);
464 for (i = 0; VEC_iterate (condition, info->conds, i, c); i++)
466 tree val = VEC_index (tree, known_vals, c->operand_num);
471 clause |= 1 << (i + predicate_first_dynamic_condition);
474 if (c->code == IS_NOT_CONSTANT)
476 res = fold_binary_to_constant (c->code, boolean_type_node, val, c->val);
478 && integer_zerop (res))
480 clause |= 1 << (i + predicate_first_dynamic_condition);
482 VEC_free (tree, heap, known_vals);
485 for (i = 0; i < (int)VEC_length (condition, info->conds); i++)
486 clause |= 1 << (i + predicate_first_dynamic_condition);
492 /* Allocate the inline summary vector or resize it to cover all cgraph nodes. */
495 inline_summary_alloc (void)
497 if (!node_removal_hook_holder)
498 node_removal_hook_holder =
499 cgraph_add_node_removal_hook (&inline_node_removal_hook, NULL);
500 if (!node_duplication_hook_holder)
501 node_duplication_hook_holder =
502 cgraph_add_node_duplication_hook (&inline_node_duplication_hook, NULL);
504 if (VEC_length (inline_summary_t, inline_summary_vec)
505 <= (unsigned) cgraph_max_uid)
506 VEC_safe_grow_cleared (inline_summary_t, gc,
507 inline_summary_vec, cgraph_max_uid + 1);
510 /* Hook that is called by cgraph.c when a node is removed. */
513 inline_node_removal_hook (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
515 struct inline_summary *info;
516 if (VEC_length (inline_summary_t, inline_summary_vec)
517 <= (unsigned)node->uid)
519 info = inline_summary (node);
520 reset_node_growth_cache (node);
521 VEC_free (condition, gc, info->conds);
522 VEC_free (size_time_entry, gc, info->entry);
525 memset (info, 0, sizeof (inline_summary_t));
528 /* Hook that is called by cgraph.c when a node is duplicated. */
531 inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
532 ATTRIBUTE_UNUSED void *data)
534 struct inline_summary *info;
535 inline_summary_alloc ();
536 info = inline_summary (dst);
537 memcpy (info, inline_summary (src),
538 sizeof (struct inline_summary));
539 info->conds = VEC_copy (condition, gc, info->conds);
540 info->entry = VEC_copy (size_time_entry, gc, info->entry);
544 /* Keep edge cache consistent across edge removal. */
547 inline_edge_removal_hook (struct cgraph_edge *edge, void *data ATTRIBUTE_UNUSED)
549 reset_edge_growth_cache (edge);
553 /* Initialize growth caches. */
556 initialize_growth_caches (void)
558 if (!edge_removal_hook_holder)
559 edge_removal_hook_holder =
560 cgraph_add_edge_removal_hook (&inline_edge_removal_hook, NULL);
561 if (cgraph_edge_max_uid)
562 VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
563 cgraph_edge_max_uid);
565 VEC_safe_grow_cleared (int, heap, node_growth_cache, cgraph_max_uid);
569 /* Free growth caches. */
572 free_growth_caches (void)
574 if (edge_removal_hook_holder)
575 cgraph_remove_edge_removal_hook (edge_removal_hook_holder);
576 VEC_free (edge_growth_cache_entry, heap, edge_growth_cache);
577 edge_growth_cache = 0;
578 VEC_free (int, heap, node_growth_cache);
579 node_growth_cache = 0;
584 dump_inline_summary (FILE * f, struct cgraph_node *node)
588 struct inline_summary *s = inline_summary (node);
591 fprintf (f, "Inline summary for %s/%i", cgraph_node_name (node),
593 if (DECL_DISREGARD_INLINE_LIMITS (node->decl))
594 fprintf (f, " always_inline");
596 fprintf (f, " inlinable");
598 fprintf (f, " versionable");
599 fprintf (f, "\n self time: %i\n",
601 fprintf (f, " global time: %i\n", s->time);
602 fprintf (f, " self size: %i\n",
604 fprintf (f, " global size: %i\n", s->size);
605 fprintf (f, " self stack: %i\n",
606 (int) s->estimated_self_stack_size);
607 fprintf (f, " global stack: %i\n",
608 (int) s->estimated_stack_size);
610 VEC_iterate (size_time_entry, s->entry, i, e);
613 fprintf (f, " size:%f, time:%f, predicate:",
614 (double) e->size / INLINE_SIZE_SCALE,
615 (double) e->time / INLINE_TIME_SCALE);
616 dump_predicate (f, s->conds, &e->predicate);
623 debug_inline_summary (struct cgraph_node *node)
625 dump_inline_summary (stderr, node);
629 dump_inline_summaries (FILE *f)
631 struct cgraph_node *node;
633 for (node = cgraph_nodes; node; node = node->next)
635 dump_inline_summary (f, node);
638 /* Give initial reasons why inlining would fail on EDGE. This gets either
639 nullified or usually overwritten by more precise reasons later. */
642 initialize_inline_failed (struct cgraph_edge *e)
644 struct cgraph_node *callee = e->callee;
646 if (e->indirect_unknown_callee)
647 e->inline_failed = CIF_INDIRECT_UNKNOWN_CALL;
648 else if (!callee->analyzed)
649 e->inline_failed = CIF_BODY_NOT_AVAILABLE;
650 else if (callee->local.redefined_extern_inline)
651 e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
652 else if (e->call_stmt && gimple_call_cannot_inline_p (e->call_stmt))
653 e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
655 e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
658 /* See if statement might disappear after inlining.
659 0 - means not eliminated
660 1 - half of statements goes away
661 2 - for sure it is eliminated.
662 We are not terribly sophisticated, basically looking for simple abstraction
666 eliminated_by_inlining_prob (gimple stmt)
668 enum gimple_code code = gimple_code (stmt);
674 if (gimple_num_ops (stmt) != 2)
677 /* Casts of parameters, loads from parameters passed by reference
678 and stores to return value or parameters are often free after
679 inlining dua to SRA and further combining.
680 Assume that half of statements goes away. */
681 if (gimple_assign_rhs_code (stmt) == CONVERT_EXPR
682 || gimple_assign_rhs_code (stmt) == NOP_EXPR
683 || gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR
684 || gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS)
686 tree rhs = gimple_assign_rhs1 (stmt);
687 tree lhs = gimple_assign_lhs (stmt);
688 tree inner_rhs = rhs;
689 tree inner_lhs = lhs;
690 bool rhs_free = false;
691 bool lhs_free = false;
693 while (handled_component_p (inner_lhs)
694 || TREE_CODE (inner_lhs) == MEM_REF)
695 inner_lhs = TREE_OPERAND (inner_lhs, 0);
696 while (handled_component_p (inner_rhs)
697 || TREE_CODE (inner_rhs) == ADDR_EXPR
698 || TREE_CODE (inner_rhs) == MEM_REF)
699 inner_rhs = TREE_OPERAND (inner_rhs, 0);
702 if (TREE_CODE (inner_rhs) == PARM_DECL
703 || (TREE_CODE (inner_rhs) == SSA_NAME
704 && SSA_NAME_IS_DEFAULT_DEF (inner_rhs)
705 && TREE_CODE (SSA_NAME_VAR (inner_rhs)) == PARM_DECL))
707 if (rhs_free && is_gimple_reg (lhs))
709 if (((TREE_CODE (inner_lhs) == PARM_DECL
710 || (TREE_CODE (inner_lhs) == SSA_NAME
711 && SSA_NAME_IS_DEFAULT_DEF (inner_lhs)
712 && TREE_CODE (SSA_NAME_VAR (inner_lhs)) == PARM_DECL))
714 || TREE_CODE (inner_lhs) == RESULT_DECL
715 || (TREE_CODE (inner_lhs) == SSA_NAME
716 && TREE_CODE (SSA_NAME_VAR (inner_lhs)) == RESULT_DECL))
719 && (is_gimple_reg (rhs) || is_gimple_min_invariant (rhs)))
721 if (lhs_free && rhs_free)
731 /* Return predicate that must be true when is E executable. */
733 static struct predicate
734 edge_execution_predicate (struct ipa_node_params *info,
735 struct inline_summary *summary,
738 struct predicate p = true_predicate ();
744 if (e->src == ENTRY_BLOCK_PTR)
747 last = last_stmt (e->src);
748 /* TODO: handle switch. */
750 || gimple_code (last) != GIMPLE_COND)
752 if (!is_gimple_ip_invariant (gimple_cond_rhs (last)))
754 op = gimple_cond_lhs (last);
755 /* TODO: handle conditionals like
758 and __bulitin_constant_p. */
759 if (TREE_CODE (op) != SSA_NAME
760 || !SSA_NAME_IS_DEFAULT_DEF (op))
762 index = ipa_get_param_decl_index (info, SSA_NAME_VAR (op));
765 code = gimple_cond_code (last);
768 code = invert_tree_comparison (code,
769 HONOR_NANS (TYPE_MODE (TREE_TYPE (op))));
771 return add_condition (summary,
773 gimple_cond_code (last),
774 gimple_cond_rhs (last));
777 static struct predicate
778 will_be_nonconstant_predicate (struct ipa_node_params *info,
779 struct inline_summary *summary,
782 struct predicate p = true_predicate ();
785 struct predicate op_non_const;
787 /* What statments might be optimized away
788 when their arguments are constant
789 TODO: also trivial builtins, especially builtin_constant_p. */
790 if (gimple_code (stmt) != GIMPLE_ASSIGN
791 && gimple_code (stmt) != GIMPLE_COND
792 && gimple_code (stmt) != GIMPLE_SWITCH)
795 /* Stores and loads will stay anyway. */
796 if (gimple_vuse (stmt))
799 /* See if we understand all operands before we start
800 adding conditionals. */
801 FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
803 /* TODO: handle nested expressions and constant
805 if (TREE_CODE (use) != SSA_NAME
806 || !SSA_NAME_IS_DEFAULT_DEF (use)
807 || ipa_get_param_decl_index (info, SSA_NAME_VAR (use)) < 0)
810 op_non_const = false_predicate ();
811 FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
813 p = add_condition (summary,
814 ipa_get_param_decl_index (info, SSA_NAME_VAR (use)),
815 IS_NOT_CONSTANT, NULL);
816 op_non_const = or_predicates (&p, &op_non_const);
822 /* Compute function body size parameters for NODE.
823 When EARLY is true, we compute only simple summaries without
824 non-trivial predicates to drive the early inliner. */
827 estimate_function_body_sizes (struct cgraph_node *node, bool early)
830 /* Estimate static overhead for function prologue/epilogue and alignment. */
832 /* Benefits are scaled by probability of elimination that is in range
835 gimple_stmt_iterator bsi;
836 struct function *my_function = DECL_STRUCT_FUNCTION (node->decl);
838 struct inline_summary *info = inline_summary (node);
839 struct predicate bb_predicate;
840 struct ipa_node_params *parms_info;
842 parms_info = ipa_node_params_vector && !early ? IPA_NODE_REF (node) : NULL;
849 fprintf (dump_file, "\nAnalyzing function body size: %s\n",
850 cgraph_node_name (node));
852 /* When we run into maximal number of entries, we assign everything to the
853 constant truth case. Be sure to have it in list. */
854 bb_predicate = true_predicate ();
855 account_size_time (info, 0, 0, &bb_predicate);
857 bb_predicate = not_inlined_predicate ();
858 account_size_time (info, 2 * INLINE_SIZE_SCALE, 0, &bb_predicate);
861 gcc_assert (my_function && my_function->cfg);
862 FOR_EACH_BB_FN (bb, my_function)
867 freq = compute_call_stmt_bb_frequency (node->decl, bb);
869 /* TODO: Obviously predicates can be propagated down across CFG. */
872 bb_predicate = false_predicate ();
873 FOR_EACH_EDGE (e, ei, bb->preds)
876 ep = edge_execution_predicate (parms_info, info, e);
877 bb_predicate = or_predicates (&ep, &bb_predicate);
881 bb_predicate = true_predicate ();
883 if (dump_file && (dump_flags & TDF_DETAILS))
885 fprintf (dump_file, "\n BB %i predicate:", bb->index);
886 dump_predicate (dump_file, info->conds, &bb_predicate);
889 for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
891 gimple stmt = gsi_stmt (bsi);
892 int this_size = estimate_num_insns (stmt, &eni_size_weights);
893 int this_time = estimate_num_insns (stmt, &eni_time_weights);
896 if (dump_file && (dump_flags & TDF_DETAILS))
898 fprintf (dump_file, " ");
899 print_gimple_stmt (dump_file, stmt, 0, 0);
900 fprintf (dump_file, "\t\tfreq:%3.2f size:%3i time:%3i\n",
901 ((double)freq)/CGRAPH_FREQ_BASE, this_size, this_time);
904 if (is_gimple_call (stmt))
906 struct cgraph_edge *edge = cgraph_edge (node, stmt);
907 edge->call_stmt_size = this_size;
908 edge->call_stmt_time = this_time;
910 /* Do not inline calls where we cannot triviall work around
911 mismatches in argument or return types. */
913 && !gimple_check_call_matching_types (stmt, edge->callee->decl))
915 edge->call_stmt_cannot_inline_p = true;
916 gimple_call_set_cannot_inline (stmt, true);
919 gcc_assert (!gimple_call_cannot_inline_p (stmt));
922 if (this_time || this_size)
924 struct predicate will_be_nonconstant;
931 prob = eliminated_by_inlining_prob (stmt);
932 if (prob == 1 && dump_file && (dump_flags & TDF_DETAILS))
933 fprintf (dump_file, "\t\t50%% will be eliminated by inlining\n");
934 if (prob == 2 && dump_file && (dump_flags & TDF_DETAILS))
935 fprintf (dump_file, "\t\twill eliminated by inlining\n");
940 = will_be_nonconstant_predicate (parms_info, info, stmt);
941 p = and_predicates (&bb_predicate, &will_be_nonconstant);
944 p = true_predicate ();
946 /* We account everything but the calls. Calls have their own
947 size/time info attached to cgraph edges. This is neccesary
948 in order to make the cost disappear after inlining. */
949 if (!is_gimple_call (stmt))
953 struct predicate ip = not_inlined_predicate ();
954 ip = and_predicates (&ip, &p);
955 account_size_time (info, this_size * prob,
956 this_time * prob, &ip);
959 account_size_time (info, this_size * (2 - prob),
960 this_time * (2 - prob), &p);
963 gcc_assert (time >= 0);
964 gcc_assert (size >= 0);
968 time = (time + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
971 inline_summary (node)->self_time = time;
972 inline_summary (node)->self_size = size;
975 fprintf (dump_file, "\n");
976 dump_inline_summary (dump_file, node);
981 /* Compute parameters of functions used by inliner.
982 EARLY is true when we compute parameters for the early inliner */
985 compute_inline_parameters (struct cgraph_node *node, bool early)
987 HOST_WIDE_INT self_stack_size;
988 struct cgraph_edge *e;
989 struct inline_summary *info;
991 gcc_assert (!node->global.inlined_to);
993 inline_summary_alloc ();
995 info = inline_summary (node);
997 /* Estimate the stack size for the function if we're optimizing. */
998 self_stack_size = optimize ? estimated_stack_frame_size (node) : 0;
999 info->estimated_self_stack_size = self_stack_size;
1000 info->estimated_stack_size = self_stack_size;
1001 info->stack_frame_offset = 0;
1003 /* Can this function be inlined at all? */
1004 info->inlinable = tree_inlinable_function_p (node->decl);
1006 /* Inlinable functions always can change signature. */
1007 if (info->inlinable)
1008 node->local.can_change_signature = true;
1011 /* Functions calling builtin_apply can not change signature. */
1012 for (e = node->callees; e; e = e->next_callee)
1013 if (DECL_BUILT_IN (e->callee->decl)
1014 && DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL
1015 && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_APPLY_ARGS)
1017 node->local.can_change_signature = !e;
1019 estimate_function_body_sizes (node, early);
1021 /* Inlining characteristics are maintained by the cgraph_mark_inline. */
1022 info->time = info->self_time;
1023 info->size = info->self_size;
1024 info->stack_frame_offset = 0;
1025 info->estimated_stack_size = info->estimated_self_stack_size;
1029 /* Compute parameters of functions used by inliner using
1030 current_function_decl. */
1033 compute_inline_parameters_for_current (void)
1035 compute_inline_parameters (cgraph_get_node (current_function_decl), true);
1039 struct gimple_opt_pass pass_inline_parameters =
1043 "inline_param", /* name */
1045 compute_inline_parameters_for_current,/* execute */
1048 0, /* static_pass_number */
1049 TV_INLINE_HEURISTICS, /* tv_id */
1050 0, /* properties_required */
1051 0, /* properties_provided */
1052 0, /* properties_destroyed */
1053 0, /* todo_flags_start */
1054 0 /* todo_flags_finish */
1059 /* Increase SIZE and TIME for size and time needed to handle edge E. */
1062 estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time)
1064 *size += e->call_stmt_size * INLINE_SIZE_SCALE;
1065 *time += (e->call_stmt_time
1066 * e->frequency * (INLINE_TIME_SCALE / CGRAPH_FREQ_BASE));
1067 if (*time > MAX_TIME * INLINE_TIME_SCALE)
1068 *time = MAX_TIME * INLINE_TIME_SCALE;
1072 /* Increase SIZE and TIME for size and time needed to handle all calls in NODE. */
1075 estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time)
1077 struct cgraph_edge *e;
1078 for (e = node->callees; e; e = e->next_callee)
1079 if (e->inline_failed)
1080 estimate_edge_size_and_time (e, size, time);
1082 estimate_calls_size_and_time (e->callee, size, time);
1083 /* TODO: look for devirtualizing oppurtunities. */
1084 for (e = node->indirect_calls; e; e = e->next_callee)
1085 estimate_edge_size_and_time (e, size, time);
1089 /* Estimate size and time needed to execute callee of EDGE assuming
1090 that parameters known to be constant at caller of EDGE are
1091 propagated. If INLINE_P is true, it is assumed that call will
1095 estimate_callee_size_and_time (struct cgraph_edge *edge, bool inline_p,
1096 int *ret_size, int *ret_time)
1098 struct inline_summary *info = inline_summary (edge->callee);
1099 clause_t clause = evaulate_conditions_for_edge (edge, inline_p);
1101 int size = 0, time = 0;
1105 && (dump_flags & TDF_DETAILS))
1108 fprintf (dump_file, " Estimating callee body: %s/%i\n"
1109 " Known to be false: ",
1110 cgraph_node_name (edge->callee),
1113 for (i = predicate_not_inlined_condition;
1114 i < (predicate_first_dynamic_condition
1115 + (int)VEC_length (condition, info->conds)); i++)
1116 if (!(clause & (1 << i)))
1119 fprintf (dump_file, ", ");
1121 dump_condition (dump_file, info->conds, i);
1125 for (i = 0; VEC_iterate (size_time_entry, info->entry, i, e); i++)
1126 if (evaulate_predicate (&e->predicate, clause))
1127 time += e->time, size += e->size;
1129 if (time > MAX_TIME * INLINE_TIME_SCALE)
1130 time = MAX_TIME * INLINE_TIME_SCALE;
1132 estimate_calls_size_and_time (edge->callee, &size, &time);
1133 time = (time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE;
1134 size = (size + INLINE_SIZE_SCALE / 2) / INLINE_SIZE_SCALE;
1138 && (dump_flags & TDF_DETAILS))
1139 fprintf (dump_file, "\n size:%i time:%i\n", size, time);
1148 /* Translate all conditions from callee representation into caller representaiton and
1149 symbolically evaulate predicate P into new predicate. */
1151 static struct predicate
1152 remap_predicate (struct inline_summary *info, struct inline_summary *callee_info,
1153 struct predicate *p,
1154 VEC (int, heap) *operand_map,
1155 clause_t possible_truths)
1158 struct predicate out = true_predicate ();
1160 /* True predicate is easy. */
1161 if (p->clause[0] == 0)
1163 for (i = 0; p->clause[i]; i++)
1165 clause_t clause = p->clause[i];
1167 struct predicate clause_predicate = false_predicate ();
1169 for (cond = 0; cond < NUM_CONDITIONS; cond ++)
1170 /* Do we have condition we can't disprove? */
1171 if (clause & possible_truths & (1 << cond))
1173 struct predicate cond_predicate;
1174 /* Work out if the condition can translate to predicate in the
1175 inlined function. */
1176 if (cond >= predicate_first_dynamic_condition)
1178 struct condition *c;
1180 c = VEC_index (condition, callee_info->conds,
1181 cond - predicate_first_dynamic_condition);
1182 /* See if we can remap condition operand to caller's operand.
1183 Otherwise give up. */
1185 || VEC_index (int, operand_map, c->operand_num) == -1)
1186 cond_predicate = true_predicate ();
1188 cond_predicate = add_condition (info,
1189 VEC_index (int, operand_map,
1193 /* Fixed conditions remains same, construct single
1194 condition predicate. */
1197 cond_predicate.clause[0] = 1 << cond;
1198 cond_predicate.clause[1] = 0;
1200 clause_predicate = or_predicates (&clause_predicate, &cond_predicate);
1202 out = and_predicates (&out, &clause_predicate);
1208 /* We inlined EDGE. Update summary of the function we inlined into. */
1211 inline_merge_summary (struct cgraph_edge *edge)
1213 struct inline_summary *callee_info = inline_summary (edge->callee);
1214 struct cgraph_node *to = (edge->caller->global.inlined_to
1215 ? edge->caller->global.inlined_to : edge->caller);
1216 struct inline_summary *info = inline_summary (to);
1217 clause_t clause = 0; /* not_inline is known to be false. */
1219 VEC (int, heap) *operand_map = NULL;
1222 if (ipa_node_params_vector && callee_info->conds
1223 /* FIXME: it seems that we forget to get argument count in some cases,
1224 probaby for previously indirect edges or so.
1225 Removing the test leads to ICE on tramp3d. */
1226 && ipa_get_cs_argument_count (IPA_EDGE_REF (edge)))
1228 struct ipa_edge_args *args = IPA_EDGE_REF (edge);
1229 int count = ipa_get_cs_argument_count (args);
1232 clause = evaulate_conditions_for_edge (edge, true);
1233 VEC_safe_grow_cleared (int, heap, operand_map, count);
1234 for (i = 0; i < count; i++)
1236 struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i);
1238 /* TODO: handle non-NOPs when merging. */
1239 if (jfunc->type == IPA_JF_PASS_THROUGH
1240 && jfunc->value.pass_through.operation == NOP_EXPR)
1241 map = jfunc->value.pass_through.formal_id;
1242 VEC_replace (int, operand_map, i, map);
1245 for (i = 0; VEC_iterate (size_time_entry, callee_info->entry, i, e); i++)
1247 struct predicate p = remap_predicate (info, callee_info,
1248 &e->predicate, operand_map, clause);
1249 gcov_type add_time = ((gcov_type)e->time * edge->frequency
1250 + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
1251 if (add_time > MAX_TIME)
1252 add_time = MAX_TIME;
1253 account_size_time (info, e->size, add_time, &p);
1257 for (i = 0; VEC_iterate (size_time_entry, info->entry, i, e); i++)
1258 info->size += e->size, info->time += e->time;
1259 estimate_calls_size_and_time (to, &info->size, &info->time);
1260 info->time = (info->time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE;
1261 info->size = (info->size + INLINE_SIZE_SCALE / 2) / INLINE_SIZE_SCALE;
1265 /* Estimate the time cost for the caller when inlining EDGE.
1266 Only to be called via estimate_edge_time, that handles the
1269 When caching, also update the cache entry. Compute both time and
1270 size, since we always need both metrics eventually. */
1273 do_estimate_edge_time (struct cgraph_edge *edge)
1279 gcc_checking_assert (edge->inline_failed);
1280 estimate_callee_size_and_time (edge, true, &size, &time);
1282 ret = (((gcov_type)time - edge->call_stmt_time) * edge->frequency
1283 + CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
1287 /* When caching, update the cache entry. */
1288 if (edge_growth_cache)
1291 if ((int)VEC_length (edge_growth_cache_entry, edge_growth_cache)
1293 VEC_safe_grow_cleared (edge_growth_cache_entry, heap, edge_growth_cache,
1294 cgraph_edge_max_uid);
1295 VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid)->time
1298 ret_size = size - edge->call_stmt_size;
1299 gcc_checking_assert (edge->call_stmt_size);
1300 VEC_index (edge_growth_cache_entry, edge_growth_cache, edge->uid)->size
1301 = ret_size + (ret_size >= 0);
1307 /* Estimate the growth of the caller when inlining EDGE.
1308 Only to be called via estimate_edge_size. */
1311 do_estimate_edge_growth (struct cgraph_edge *edge)
1315 /* When we do caching, use do_estimate_edge_time to populate the entry. */
1317 if (edge_growth_cache)
1319 do_estimate_edge_time (edge);
1320 size = VEC_index (edge_growth_cache_entry,
1323 gcc_checking_assert (size);
1324 return size - (size > 0);
1327 /* Early inliner runs without caching, go ahead and do the dirty work. */
1328 gcc_checking_assert (edge->inline_failed);
1329 estimate_callee_size_and_time (edge, true, &size, NULL);
1330 gcc_checking_assert (edge->call_stmt_size);
1331 return size - edge->call_stmt_size;
1335 /* Estimate self time of the function NODE after inlining EDGE. */
1338 estimate_time_after_inlining (struct cgraph_node *node,
1339 struct cgraph_edge *edge)
1341 gcov_type time = inline_summary (node)->time + estimate_edge_time (edge);
1344 if (time > MAX_TIME)
1350 /* Estimate the size of NODE after inlining EDGE which should be an
1351 edge to either NODE or a call inlined into NODE. */
1354 estimate_size_after_inlining (struct cgraph_node *node,
1355 struct cgraph_edge *edge)
1357 int size = inline_summary (node)->size + estimate_edge_growth (edge);
1358 gcc_assert (size >= 0);
1363 /* Estimate the growth caused by inlining NODE into all callees. */
1366 do_estimate_growth (struct cgraph_node *node)
1369 struct cgraph_edge *e;
1370 bool self_recursive = false;
1371 struct inline_summary *info = inline_summary (node);
1373 for (e = node->callers; e; e = e->next_caller)
1375 gcc_checking_assert (e->inline_failed);
1377 if (e->caller == node
1378 || (e->caller->global.inlined_to
1379 && e->caller->global.inlined_to == node))
1380 self_recursive = true;
1381 growth += estimate_edge_growth (e);
1385 /* For self recursive functions the growth estimation really should be
1386 infinity. We don't want to return very large values because the growth
1387 plays various roles in badness computation fractions. Be sure to not
1388 return zero or negative growths. */
1390 growth = growth < info->size ? info->size : growth;
1393 if (cgraph_will_be_removed_from_program_if_no_direct_calls (node)
1394 && !DECL_EXTERNAL (node->decl))
1395 growth -= info->size;
1396 /* COMDAT functions are very often not shared across multiple units since they
1397 come from various template instantiations. Take this into account. */
1398 else if (DECL_COMDAT (node->decl)
1399 && cgraph_can_remove_if_no_direct_calls_p (node))
1400 growth -= (info->size
1401 * (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY)) + 50) / 100;
1404 if (node_growth_cache)
1406 if ((int)VEC_length (int, node_growth_cache) <= node->uid)
1407 VEC_safe_grow_cleared (int, heap, node_growth_cache, cgraph_max_uid);
1408 VEC_replace (int, node_growth_cache, node->uid, growth + (growth >= 0));
1414 /* This function performs intraprocedural analysis in NODE that is required to
1415 inline indirect calls. */
1418 inline_indirect_intraprocedural_analysis (struct cgraph_node *node)
1420 ipa_analyze_node (node);
1421 if (dump_file && (dump_flags & TDF_DETAILS))
1423 ipa_print_node_params (dump_file, node);
1424 ipa_print_node_jump_functions (dump_file, node);
1429 /* Note function body size. */
1432 inline_analyze_function (struct cgraph_node *node)
1434 push_cfun (DECL_STRUCT_FUNCTION (node->decl));
1435 current_function_decl = node->decl;
1438 fprintf (dump_file, "\nAnalyzing function: %s/%u\n",
1439 cgraph_node_name (node), node->uid);
1440 /* FIXME: We should remove the optimize check after we ensure we never run
1441 IPA passes when not optimizing. */
1442 if (flag_indirect_inlining && optimize)
1443 inline_indirect_intraprocedural_analysis (node);
1444 compute_inline_parameters (node, false);
1446 current_function_decl = NULL;
1451 /* Called when new function is inserted to callgraph late. */
1454 add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
1456 inline_analyze_function (node);
1460 /* Note function body size. */
1463 inline_generate_summary (void)
1465 struct cgraph_node *node;
1467 function_insertion_hook_holder =
1468 cgraph_add_function_insertion_hook (&add_new_function, NULL);
1470 if (flag_indirect_inlining)
1471 ipa_register_cgraph_hooks ();
1473 for (node = cgraph_nodes; node; node = node->next)
1475 inline_analyze_function (node);
1479 /* Stream in inline summaries from the section. */
1482 inline_read_section (struct lto_file_decl_data *file_data, const char *data,
1485 const struct lto_function_header *header =
1486 (const struct lto_function_header *) data;
1487 const int32_t cfg_offset = sizeof (struct lto_function_header);
1488 const int32_t main_offset = cfg_offset + header->cfg_size;
1489 const int32_t string_offset = main_offset + header->main_size;
1490 struct data_in *data_in;
1491 struct lto_input_block ib;
1492 unsigned int i, count2, j;
1493 unsigned int f_count;
1495 LTO_INIT_INPUT_BLOCK (ib, (const char *) data + main_offset, 0,
1499 lto_data_in_create (file_data, (const char *) data + string_offset,
1500 header->string_size, NULL);
1501 f_count = lto_input_uleb128 (&ib);
1502 for (i = 0; i < f_count; i++)
1505 struct cgraph_node *node;
1506 struct inline_summary *info;
1507 lto_cgraph_encoder_t encoder;
1508 struct bitpack_d bp;
1510 index = lto_input_uleb128 (&ib);
1511 encoder = file_data->cgraph_node_encoder;
1512 node = lto_cgraph_encoder_deref (encoder, index);
1513 info = inline_summary (node);
1515 info->estimated_stack_size
1516 = info->estimated_self_stack_size = lto_input_uleb128 (&ib);
1517 info->size = info->self_size = lto_input_uleb128 (&ib);
1518 info->time = info->self_time = lto_input_uleb128 (&ib);
1520 bp = lto_input_bitpack (&ib);
1521 info->inlinable = bp_unpack_value (&bp, 1);
1522 info->versionable = bp_unpack_value (&bp, 1);
1524 count2 = lto_input_uleb128 (&ib);
1525 gcc_assert (!info->conds);
1526 for (j = 0; j < count2; j++)
1529 c.operand_num = lto_input_uleb128 (&ib);
1530 c.code = (enum tree_code) lto_input_uleb128 (&ib);
1531 c.val = lto_input_tree (&ib, data_in);
1532 VEC_safe_push (condition, gc, info->conds, &c);
1534 count2 = lto_input_uleb128 (&ib);
1535 gcc_assert (!info->entry);
1536 for (j = 0; j < count2; j++)
1538 struct size_time_entry e;
1542 e.size = lto_input_uleb128 (&ib);
1543 e.time = lto_input_uleb128 (&ib);
1546 clause = e.predicate.clause[k++] = lto_input_uleb128 (&ib);
1550 VEC_safe_push (size_time_entry, gc, info->entry, &e);
1554 lto_free_section_data (file_data, LTO_section_inline_summary, NULL, data,
1556 lto_data_in_delete (data_in);
1560 /* Read inline summary. Jump functions are shared among ipa-cp
1561 and inliner, so when ipa-cp is active, we don't need to write them
1565 inline_read_summary (void)
1567 struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
1568 struct lto_file_decl_data *file_data;
1571 inline_summary_alloc ();
1573 while ((file_data = file_data_vec[j++]))
1576 const char *data = lto_get_section_data (file_data, LTO_section_inline_summary, NULL, &len);
1578 inline_read_section (file_data, data, len);
1580 /* Fatal error here. We do not want to support compiling ltrans units with
1581 different version of compiler or different flags than the WPA unit, so
1582 this should never happen. */
1583 fatal_error ("ipa inline summary is missing in input file");
1585 if (flag_indirect_inlining)
1587 ipa_register_cgraph_hooks ();
1589 ipa_prop_read_jump_functions ();
1591 function_insertion_hook_holder =
1592 cgraph_add_function_insertion_hook (&add_new_function, NULL);
1596 /* Write inline summary for node in SET.
1597 Jump functions are shared among ipa-cp and inliner, so when ipa-cp is
1598 active, we don't need to write them twice. */
1601 inline_write_summary (cgraph_node_set set,
1602 varpool_node_set vset ATTRIBUTE_UNUSED)
1604 struct cgraph_node *node;
1605 struct output_block *ob = create_output_block (LTO_section_inline_summary);
1606 lto_cgraph_encoder_t encoder = ob->decl_state->cgraph_node_encoder;
1607 unsigned int count = 0;
1610 for (i = 0; i < lto_cgraph_encoder_size (encoder); i++)
1611 if (lto_cgraph_encoder_deref (encoder, i)->analyzed)
1613 lto_output_uleb128_stream (ob->main_stream, count);
1615 for (i = 0; i < lto_cgraph_encoder_size (encoder); i++)
1617 node = lto_cgraph_encoder_deref (encoder, i);
1620 struct inline_summary *info = inline_summary (node);
1621 struct bitpack_d bp;
1624 struct condition *c;
1627 lto_output_uleb128_stream (ob->main_stream,
1628 lto_cgraph_encoder_encode (encoder, node));
1629 lto_output_sleb128_stream (ob->main_stream,
1630 info->estimated_self_stack_size);
1631 lto_output_sleb128_stream (ob->main_stream,
1633 lto_output_sleb128_stream (ob->main_stream,
1635 bp = bitpack_create (ob->main_stream);
1636 bp_pack_value (&bp, info->inlinable, 1);
1637 bp_pack_value (&bp, info->versionable, 1);
1638 lto_output_bitpack (&bp);
1639 lto_output_uleb128_stream (ob->main_stream,
1640 VEC_length (condition, info->conds));
1641 for (i = 0; VEC_iterate (condition, info->conds, i, c); i++)
1643 lto_output_uleb128_stream (ob->main_stream,
1645 lto_output_uleb128_stream (ob->main_stream,
1647 lto_output_tree (ob, c->val, true);
1649 lto_output_uleb128_stream (ob->main_stream,
1650 VEC_length (size_time_entry, info->entry));
1652 VEC_iterate (size_time_entry, info->entry, i, e);
1656 lto_output_uleb128_stream (ob->main_stream,
1658 lto_output_uleb128_stream (ob->main_stream,
1660 for (j = 0; e->predicate.clause[j]; j++)
1661 lto_output_uleb128_stream (ob->main_stream,
1662 e->predicate.clause[j]);
1663 lto_output_uleb128_stream (ob->main_stream, 0);
1667 lto_output_1_stream (ob->main_stream, 0);
1668 produce_asm (ob, NULL);
1669 destroy_output_block (ob);
1671 if (flag_indirect_inlining && !flag_ipa_cp)
1672 ipa_prop_write_jump_functions (set);
1676 /* Release inline summary. */
1679 inline_free_summary (void)
1681 if (function_insertion_hook_holder)
1682 cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
1683 function_insertion_hook_holder = NULL;
1684 if (node_removal_hook_holder)
1685 cgraph_remove_node_removal_hook (node_removal_hook_holder);
1686 node_removal_hook_holder = NULL;
1687 if (node_duplication_hook_holder)
1688 cgraph_remove_node_duplication_hook (node_duplication_hook_holder);
1689 node_duplication_hook_holder = NULL;
1690 VEC_free (inline_summary_t, gc, inline_summary_vec);
1691 inline_summary_vec = NULL;