1 /* Callgraph handling code.
2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Jan Hubicka
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 /* This file contains basic routines manipulating call graph and variable pool
26 The call-graph is data structure designed for intra-procedural optimization
27 but it is also used in non-unit-at-a-time compilation to allow easier code
30 The call-graph consist of nodes and edges represented via linked lists.
31 Each function (external or not) corresponds to the unique node (in
32 contrast to tree DECL nodes where we can have multiple nodes for each
35 The mapping from declarations to call-graph nodes is done using hash table
36 based on DECL_ASSEMBLER_NAME, so it is essential for assembler name to
37 not change once the declaration is inserted into the call-graph.
38 The call-graph nodes are created lazily using cgraph_node function when
39 called for unknown declaration.
41 When built, there is one edge for each direct call. It is possible that
42 the reference will be later optimized out. The call-graph is built
43 conservatively in order to make conservative data flow analysis possible.
45 The callgraph at the moment does not represent indirect calls or calls
46 from other compilation unit. Flag NEEDED is set for each node that may
47 be accessed in such an invisible way and it shall be considered an
48 entry point to the callgraph.
50 Intraprocedural information:
52 Callgraph is place to store data needed for intraprocedural optimization.
53 All data structures are divided into three components: local_info that
54 is produced while analyzing the function, global_info that is result
55 of global walking of the callgraph on the end of compilation and
56 rtl_info used by RTL backend to propagate data from already compiled
57 functions to their callers.
61 The function inlining information is decided in advance and maintained
62 in the callgraph as so called inline plan.
63 For each inlined call, the callee's node is cloned to represent the
64 new function copy produced by inliner.
65 Each inlined call gets a unique corresponding clone node of the callee
66 and the data structure is updated while inlining is performed, so
67 the clones are eliminated and their callee edges redirected to the
70 Each edge has "inline_failed" field. When the field is set to NULL,
71 the call will be inlined. When it is non-NULL it contains a reason
72 why inlining wasn't performed.
75 The varpool data structure:
77 Varpool is used to maintain variables in similar manner as call-graph
78 is used for functions. Most of the API is symmetric replacing cgraph
79 function prefix by cgraph_varpool */
84 #include "coretypes.h"
87 #include "tree-inline.h"
88 #include "langhooks.h"
95 #include "basic-block.h"
100 #include "tree-gimple.h"
102 static void cgraph_node_remove_callers (struct cgraph_node *node);
103 static inline void cgraph_edge_remove_caller (struct cgraph_edge *e);
104 static inline void cgraph_edge_remove_callee (struct cgraph_edge *e);
106 /* Hash table used to convert declarations into nodes. */
107 static GTY((param_is (struct cgraph_node))) htab_t cgraph_hash;
109 /* The linked list of cgraph nodes. */
110 struct cgraph_node *cgraph_nodes;
112 /* Queue of cgraph nodes scheduled to be lowered. */
113 struct cgraph_node *cgraph_nodes_queue;
115 /* Number of nodes in existence. */
118 /* Maximal uid used in cgraph nodes. */
121 /* Set when whole unit has been analyzed so we can access global info. */
122 bool cgraph_global_info_ready = false;
124 /* Set when the cgraph is fully build and the basic flags are computed. */
125 bool cgraph_function_flags_ready = false;
127 /* Hash table used to convert declarations into nodes. */
128 static GTY((param_is (struct cgraph_varpool_node))) htab_t cgraph_varpool_hash;
130 /* Queue of cgraph nodes scheduled to be lowered and output. */
131 struct cgraph_varpool_node *cgraph_varpool_nodes_queue, *cgraph_varpool_first_unanalyzed_node;
134 /* The linked list of cgraph varpool nodes. */
135 static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
137 /* End of the varpool queue. Needs to be QTYed to work with PCH. */
138 static GTY(()) struct cgraph_varpool_node *cgraph_varpool_last_needed_node;
140 static hashval_t hash_node (const void *);
141 static int eq_node (const void *, const void *);
143 /* Returns a hash code for P. */
146 hash_node (const void *p)
148 const struct cgraph_node *n = p;
149 return (hashval_t) DECL_UID (n->decl);
152 /* Returns nonzero if P1 and P2 are equal. */
155 eq_node (const void *p1, const void *p2)
157 const struct cgraph_node *n1 = p1, *n2 = p2;
158 return DECL_UID (n1->decl) == DECL_UID (n2->decl);
161 /* Allocate new callgraph node and insert it into basic data structures. */
162 static struct cgraph_node *
163 cgraph_create_node (void)
165 struct cgraph_node *node;
167 node = ggc_alloc_cleared (sizeof (*node));
168 node->next = cgraph_nodes;
169 node->uid = cgraph_max_uid++;
171 cgraph_nodes->previous = node;
172 node->previous = NULL;
173 node->global.estimated_growth = INT_MIN;
179 /* Return cgraph node assigned to DECL. Create new one when needed. */
181 cgraph_node (tree decl)
183 struct cgraph_node key, *node, **slot;
185 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
188 cgraph_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
192 slot = (struct cgraph_node **) htab_find_slot (cgraph_hash, &key, INSERT);
197 node = cgraph_create_node ();
200 if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
202 node->origin = cgraph_node (DECL_CONTEXT (decl));
203 node->next_nested = node->origin->nested;
204 node->origin->nested = node;
209 /* Compare ASMNAME with the DECL_ASSEMBLER_NAME of DECL. */
212 decl_assembler_name_equal (tree decl, tree asmname)
214 tree decl_asmname = DECL_ASSEMBLER_NAME (decl);
216 if (decl_asmname == asmname)
219 /* If the target assembler name was set by the user, things are trickier.
220 We have a leading '*' to begin with. After that, it's arguable what
221 is the correct thing to do with -fleading-underscore. Arguably, we've
222 historically been doing the wrong thing in assemble_alias by always
223 printing the leading underscore. Since we're not changing that, make
224 sure user_label_prefix follows the '*' before matching. */
225 if (IDENTIFIER_POINTER (decl_asmname)[0] == '*')
227 const char *decl_str = IDENTIFIER_POINTER (decl_asmname) + 1;
228 size_t ulp_len = strlen (user_label_prefix);
232 else if (strncmp (decl_str, user_label_prefix, ulp_len) == 0)
237 return strcmp (decl_str, IDENTIFIER_POINTER (asmname)) == 0;
244 /* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME.
245 Return NULL if there's no such node. */
248 cgraph_node_for_asm (tree asmname)
250 struct cgraph_node *node;
252 for (node = cgraph_nodes; node ; node = node->next)
253 if (decl_assembler_name_equal (node->decl, asmname))
259 /* Return callgraph edge representing CALL_EXPR statement. */
261 cgraph_edge (struct cgraph_node *node, tree call_stmt)
263 struct cgraph_edge *e;
265 /* This loop may turn out to be performance problem. In such case adding
266 hashtables into call nodes with very many edges is probably best
267 solution. It is not good idea to add pointer into CALL_EXPR itself
268 because we want to make possible having multiple cgraph nodes representing
269 different clones of the same body before the body is actually cloned. */
270 for (e = node->callees; e; e= e->next_callee)
271 if (e->call_stmt == call_stmt)
276 /* Create edge from CALLER to CALLEE in the cgraph. */
279 cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
280 tree call_stmt, gcov_type count, int nest)
282 struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
283 #ifdef ENABLE_CHECKING
284 struct cgraph_edge *e;
286 for (e = caller->callees; e; e = e->next_callee)
287 gcc_assert (e->call_stmt != call_stmt);
290 gcc_assert (get_call_expr_in (call_stmt));
292 if (!DECL_SAVED_TREE (callee->decl))
293 edge->inline_failed = N_("function body not available");
294 else if (callee->local.redefined_extern_inline)
295 edge->inline_failed = N_("redefined extern inline functions are not "
296 "considered for inlining");
297 else if (callee->local.inlinable)
298 edge->inline_failed = N_("function not considered for inlining");
300 edge->inline_failed = N_("function not inlinable");
304 edge->caller = caller;
305 edge->callee = callee;
306 edge->call_stmt = call_stmt;
307 edge->prev_caller = NULL;
308 edge->next_caller = callee->callers;
310 callee->callers->prev_caller = edge;
311 edge->prev_callee = NULL;
312 edge->next_callee = caller->callees;
314 caller->callees->prev_callee = edge;
315 caller->callees = edge;
316 callee->callers = edge;
318 edge->loop_nest = nest;
322 /* Remove the edge E from the list of the callers of the callee. */
325 cgraph_edge_remove_callee (struct cgraph_edge *e)
328 e->prev_caller->next_caller = e->next_caller;
330 e->next_caller->prev_caller = e->prev_caller;
332 e->callee->callers = e->next_caller;
335 /* Remove the edge E from the list of the callees of the caller. */
338 cgraph_edge_remove_caller (struct cgraph_edge *e)
341 e->prev_callee->next_callee = e->next_callee;
343 e->next_callee->prev_callee = e->prev_callee;
345 e->caller->callees = e->next_callee;
348 /* Remove the edge E in the cgraph. */
351 cgraph_remove_edge (struct cgraph_edge *e)
353 /* Remove from callers list of the callee. */
354 cgraph_edge_remove_callee (e);
356 /* Remove from callees list of the callers. */
357 cgraph_edge_remove_caller (e);
360 /* Redirect callee of E to N. The function does not update underlying
364 cgraph_redirect_edge_callee (struct cgraph_edge *e, struct cgraph_node *n)
366 /* Remove from callers list of the current callee. */
367 cgraph_edge_remove_callee (e);
369 /* Insert to callers list of the new callee. */
370 e->prev_caller = NULL;
372 n->callers->prev_caller = e;
373 e->next_caller = n->callers;
378 /* Remove all callees from the node. */
381 cgraph_node_remove_callees (struct cgraph_node *node)
383 struct cgraph_edge *e;
385 /* It is sufficient to remove the edges from the lists of callers of
386 the callees. The callee list of the node can be zapped with one
388 for (e = node->callees; e; e = e->next_callee)
389 cgraph_edge_remove_callee (e);
390 node->callees = NULL;
393 /* Remove all callers from the node. */
396 cgraph_node_remove_callers (struct cgraph_node *node)
398 struct cgraph_edge *e;
400 /* It is sufficient to remove the edges from the lists of callees of
401 the callers. The caller list of the node can be zapped with one
403 for (e = node->callers; e; e = e->next_caller)
404 cgraph_edge_remove_caller (e);
405 node->callers = NULL;
408 /* Remove the node from cgraph. */
411 cgraph_remove_node (struct cgraph_node *node)
414 bool kill_body = false;
416 cgraph_node_remove_callers (node);
417 cgraph_node_remove_callees (node);
419 cgraph_remove_node (node->nested);
422 struct cgraph_node **node2 = &node->origin->nested;
424 while (*node2 != node)
425 node2 = &(*node2)->next_nested;
426 *node2 = node->next_nested;
429 node->previous->next = node->next;
431 cgraph_nodes = node->next;
433 node->next->previous = node->previous;
434 slot = htab_find_slot (cgraph_hash, node, NO_INSERT);
437 if (node->next_clone)
439 *slot = node->next_clone;
440 node->next_clone->prev_clone = NULL;
444 htab_clear_slot (cgraph_hash, slot);
450 node->prev_clone->next_clone = node->next_clone;
451 if (node->next_clone)
452 node->next_clone->prev_clone = node->prev_clone;
455 /* While all the clones are removed after being proceeded, the function
456 itself is kept in the cgraph even after it is compiled. Check whether
457 we are done with this body and reclaim it proactively if this is the case.
459 if (!kill_body && *slot)
461 struct cgraph_node *n = *slot;
462 if (!n->next_clone && !n->global.inlined_to
463 && (TREE_ASM_WRITTEN (n->decl) || DECL_EXTERNAL (n->decl)))
467 if (kill_body && !dump_enabled_p (TDI_tree_all) && flag_unit_at_a_time)
469 DECL_SAVED_TREE (node->decl) = NULL;
470 DECL_STRUCT_FUNCTION (node->decl) = NULL;
471 DECL_INITIAL (node->decl) = error_mark_node;
474 /* Do not free the structure itself so the walk over chain can continue. */
477 /* Notify finalize_compilation_unit that given node is reachable. */
480 cgraph_mark_reachable_node (struct cgraph_node *node)
482 if (!node->reachable && node->local.finalized)
484 notice_global_symbol (node->decl);
486 gcc_assert (!cgraph_global_info_ready);
488 node->next_needed = cgraph_nodes_queue;
489 cgraph_nodes_queue = node;
493 /* Likewise indicate that a node is needed, i.e. reachable via some
497 cgraph_mark_needed_node (struct cgraph_node *node)
500 cgraph_mark_reachable_node (node);
503 /* Return local info for the compiled function. */
505 struct cgraph_local_info *
506 cgraph_local_info (tree decl)
508 struct cgraph_node *node;
510 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
511 node = cgraph_node (decl);
515 /* Return local info for the compiled function. */
517 struct cgraph_global_info *
518 cgraph_global_info (tree decl)
520 struct cgraph_node *node;
522 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL && cgraph_global_info_ready);
523 node = cgraph_node (decl);
524 return &node->global;
527 /* Return local info for the compiled function. */
529 struct cgraph_rtl_info *
530 cgraph_rtl_info (tree decl)
532 struct cgraph_node *node;
534 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
535 node = cgraph_node (decl);
536 if (decl != current_function_decl
537 && !TREE_ASM_WRITTEN (node->decl))
542 /* Return name of the node used in debug output. */
544 cgraph_node_name (struct cgraph_node *node)
546 return lang_hooks.decl_printable_name (node->decl, 2);
549 /* Return name of the node used in debug output. */
551 cgraph_varpool_node_name (struct cgraph_varpool_node *node)
553 return lang_hooks.decl_printable_name (node->decl, 2);
556 /* Dump given cgraph node. */
558 dump_cgraph_node (FILE *f, struct cgraph_node *node)
560 struct cgraph_edge *edge;
561 fprintf (f, "%s/%i:", cgraph_node_name (node), node->uid);
562 if (node->global.inlined_to)
563 fprintf (f, " (inline copy in %s/%i)",
564 cgraph_node_name (node->global.inlined_to),
565 node->global.inlined_to->uid);
567 fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x",
568 (HOST_WIDEST_INT)node->count);
569 if (node->local.self_insns)
570 fprintf (f, " %i insns", node->local.self_insns);
571 if (node->global.insns && node->global.insns != node->local.self_insns)
572 fprintf (f, " (%i after inlining)", node->global.insns);
574 fprintf (f, " nested in: %s", cgraph_node_name (node->origin));
576 fprintf (f, " needed");
577 else if (node->reachable)
578 fprintf (f, " reachable");
579 if (DECL_SAVED_TREE (node->decl))
580 fprintf (f, " tree");
582 fprintf (f, " output");
583 if (node->local.local)
584 fprintf (f, " local");
585 if (node->local.disregard_inline_limits)
586 fprintf (f, " always_inline");
587 else if (node->local.inlinable)
588 fprintf (f, " inlinable");
589 if (TREE_ASM_WRITTEN (node->decl))
590 fprintf (f, " asm_written");
592 fprintf (f, "\n called by: ");
593 for (edge = node->callers; edge; edge = edge->next_caller)
595 fprintf (f, "%s/%i ", cgraph_node_name (edge->caller),
598 fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ",
599 (HOST_WIDEST_INT)edge->count);
600 if (!edge->inline_failed)
601 fprintf(f, "(inlined) ");
604 fprintf (f, "\n calls: ");
605 for (edge = node->callees; edge; edge = edge->next_callee)
607 fprintf (f, "%s/%i ", cgraph_node_name (edge->callee),
609 if (!edge->inline_failed)
610 fprintf(f, "(inlined) ");
615 /* Dump the callgraph. */
618 dump_cgraph (FILE *f)
620 struct cgraph_node *node;
622 fprintf (f, "callgraph:\n\n");
623 for (node = cgraph_nodes; node; node = node->next)
624 dump_cgraph_node (f, node);
627 /* Dump given cgraph node. */
629 dump_cgraph_varpool_node (FILE *f, struct cgraph_varpool_node *node)
631 fprintf (f, "%s:", cgraph_varpool_node_name (node));
632 if (DECL_INITIAL (node->decl))
633 fprintf (f, " initialized");
635 fprintf (f, " needed");
637 fprintf (f, " analyzed");
639 fprintf (f, " finalized");
641 fprintf (f, " output");
645 /* Dump the callgraph. */
648 dump_varpool (FILE *f)
650 struct cgraph_varpool_node *node;
652 fprintf (f, "variable pool:\n\n");
653 for (node = cgraph_varpool_nodes; node; node = node->next_needed)
654 dump_cgraph_varpool_node (f, node);
657 /* Returns a hash code for P. */
660 hash_varpool_node (const void *p)
662 const struct cgraph_varpool_node *n = p;
663 return (hashval_t) DECL_UID (n->decl);
666 /* Returns nonzero if P1 and P2 are equal. */
669 eq_varpool_node (const void *p1, const void *p2)
671 const struct cgraph_varpool_node *n1 = p1, *n2 = p2;
672 return DECL_UID (n1->decl) == DECL_UID (n2->decl);
675 /* Return cgraph_varpool node assigned to DECL. Create new one when needed. */
676 struct cgraph_varpool_node *
677 cgraph_varpool_node (tree decl)
679 struct cgraph_varpool_node key, *node, **slot;
681 gcc_assert (DECL_P (decl) && TREE_CODE (decl) != FUNCTION_DECL);
683 if (!cgraph_varpool_hash)
684 cgraph_varpool_hash = htab_create_ggc (10, hash_varpool_node,
685 eq_varpool_node, NULL);
687 slot = (struct cgraph_varpool_node **)
688 htab_find_slot (cgraph_varpool_hash, &key, INSERT);
691 node = ggc_alloc_cleared (sizeof (*node));
693 node->next = cgraph_varpool_nodes;
694 cgraph_varpool_nodes = node;
699 struct cgraph_varpool_node *
700 cgraph_varpool_node_for_asm (tree asmname)
702 struct cgraph_varpool_node *node;
704 for (node = cgraph_varpool_nodes; node ; node = node->next)
705 if (decl_assembler_name_equal (node->decl, asmname))
711 /* Set the DECL_ASSEMBLER_NAME and update cgraph hashtables. */
713 change_decl_assembler_name (tree decl, tree name)
715 if (!DECL_ASSEMBLER_NAME_SET_P (decl))
717 SET_DECL_ASSEMBLER_NAME (decl, name);
720 if (name == DECL_ASSEMBLER_NAME (decl))
723 if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
724 && DECL_RTL_SET_P (decl))
725 warning (0, "%D renamed after being referenced in assembly", decl);
727 SET_DECL_ASSEMBLER_NAME (decl, name);
730 /* Helper function for finalization code - add node into lists so it will
731 be analyzed and compiled. */
733 cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *node)
735 if (cgraph_varpool_last_needed_node)
736 cgraph_varpool_last_needed_node->next_needed = node;
737 cgraph_varpool_last_needed_node = node;
738 node->next_needed = NULL;
739 if (!cgraph_varpool_nodes_queue)
740 cgraph_varpool_nodes_queue = node;
741 if (!cgraph_varpool_first_unanalyzed_node)
742 cgraph_varpool_first_unanalyzed_node = node;
743 notice_global_symbol (node->decl);
746 /* Reset the queue of needed nodes. */
748 cgraph_varpool_reset_queue (void)
750 cgraph_varpool_last_needed_node = NULL;
751 cgraph_varpool_nodes_queue = NULL;
752 cgraph_varpool_first_unanalyzed_node = NULL;
755 /* Notify finalize_compilation_unit that given node is reachable
758 cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *node)
760 if (!node->needed && node->finalized)
761 cgraph_varpool_enqueue_needed_node (node);
765 /* Determine if variable DECL is needed. That is, visible to something
766 either outside this translation unit, something magic in the system
767 configury, or (if not doing unit-at-a-time) to something we haven't
771 decide_is_variable_needed (struct cgraph_varpool_node *node, tree decl)
773 /* If the user told us it is used, then it must be so. */
774 if (lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
777 /* ??? If the assembler name is set by hand, it is possible to assemble
778 the name later after finalizing the function and the fact is noticed
779 in assemble_name then. This is arguably a bug. */
780 if (DECL_ASSEMBLER_NAME_SET_P (decl)
781 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
784 /* If we decided it was needed before, but at the time we didn't have
785 the definition available, then it's still needed. */
789 /* Externally visible functions must be output. The exception is
790 COMDAT functions that must be output only when they are needed. */
791 if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
794 if (flag_unit_at_a_time)
797 /* If not doing unit at a time, then we'll only defer this function
798 if its marked for inlining. Otherwise we want to emit it now. */
800 /* We want to emit COMDAT variables only when absolutely necessary. */
801 if (DECL_COMDAT (decl))
807 cgraph_varpool_finalize_decl (tree decl)
809 struct cgraph_varpool_node *node = cgraph_varpool_node (decl);
811 /* The first declaration of a variable that comes through this function
812 decides whether it is global (in C, has external linkage)
813 or local (in C, has internal linkage). So do nothing more
814 if this function has already run. */
817 if (cgraph_global_info_ready || !flag_unit_at_a_time)
818 cgraph_varpool_assemble_pending_decls ();
822 cgraph_varpool_enqueue_needed_node (node);
823 node->finalized = true;
825 if (decide_is_variable_needed (node, decl))
826 cgraph_varpool_mark_needed_node (node);
827 if (cgraph_global_info_ready || !flag_unit_at_a_time)
828 cgraph_varpool_assemble_pending_decls ();
831 /* Return true when the DECL can possibly be inlined. */
833 cgraph_function_possibly_inlined_p (tree decl)
835 if (!cgraph_global_info_ready)
836 return (DECL_INLINE (decl) && !flag_really_no_inline);
837 return DECL_POSSIBLY_INLINED (decl);
840 /* Create clone of E in the node N represented by CALL_EXPR the callgraph. */
842 cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
843 tree call_stmt, int count_scale, int loop_nest)
845 struct cgraph_edge *new;
847 new = cgraph_create_edge (n, e->callee, call_stmt,
848 e->count * count_scale / REG_BR_PROB_BASE,
849 e->loop_nest + loop_nest);
851 new->inline_failed = e->inline_failed;
852 e->count -= new->count;
856 /* Create node representing clone of N executed COUNT times. Decrease
857 the execution counts from original node too. */
859 cgraph_clone_node (struct cgraph_node *n, gcov_type count, int loop_nest)
861 struct cgraph_node *new = cgraph_create_node ();
862 struct cgraph_edge *e;
866 new->origin = n->origin;
869 new->next_nested = new->origin->nested;
870 new->origin->nested = new;
872 new->analyzed = n->analyzed;
873 new->local = n->local;
874 new->global = n->global;
878 count_scale = new->count * REG_BR_PROB_BASE / n->count;
883 for (e = n->callees;e; e=e->next_callee)
884 cgraph_clone_edge (e, new, e->call_stmt, count_scale, loop_nest);
886 new->next_clone = n->next_clone;
890 new->next_clone->prev_clone = new;
895 /* NODE is no longer nested function; update cgraph accordingly. */
897 cgraph_unnest_node (struct cgraph_node *node)
899 struct cgraph_node **node2 = &node->origin->nested;
900 gcc_assert (node->origin);
902 while (*node2 != node)
903 node2 = &(*node2)->next_nested;
904 *node2 = node->next_nested;
907 #include "gt-cgraph.h"