Lines Matching refs:node

107                                  struct cgraph_node *node)  in lto_cgraph_encoder_encode()  argument
112 slot = pointer_map_contains (encoder->map, node); in lto_cgraph_encoder_encode()
116 slot = pointer_map_insert (encoder->map, node); in lto_cgraph_encoder_encode()
118 VEC_safe_push (cgraph_node_ptr, heap, encoder->nodes, node); in lto_cgraph_encoder_encode()
133 struct cgraph_node *node) in lto_cgraph_encoder_lookup() argument
135 void **slot = pointer_map_contains (encoder->map, node); in lto_cgraph_encoder_lookup()
156 struct cgraph_node *node) in lto_cgraph_encoder_encode_body_p() argument
158 return pointer_set_contains (encoder->body, node); in lto_cgraph_encoder_encode_body_p()
165 struct cgraph_node *node) in lto_set_cgraph_encoder_encode_body() argument
167 pointer_set_insert (encoder->body, node); in lto_set_cgraph_encoder_encode_body()
201 struct varpool_node *node) in lto_varpool_encoder_encode() argument
206 slot = pointer_map_contains (encoder->map, node); in lto_varpool_encoder_encode()
210 slot = pointer_map_insert (encoder->map, node); in lto_varpool_encoder_encode()
212 VEC_safe_push (varpool_node_ptr, heap, encoder->nodes, node); in lto_varpool_encoder_encode()
225 struct varpool_node *node) in lto_varpool_encoder_lookup() argument
227 void **slot = pointer_map_contains (encoder->map, node); in lto_varpool_encoder_lookup()
248 struct varpool_node *node) in lto_varpool_encoder_encode_initializer_p() argument
250 return pointer_set_contains (encoder->initializer, node); in lto_varpool_encoder_encode_initializer_p()
257 struct varpool_node *node) in lto_set_varpool_encoder_encode_initializer() argument
259 pointer_set_insert (encoder->initializer, node); in lto_set_varpool_encoder_encode_initializer()
351 reachable_from_other_partition_p (struct cgraph_node *node, cgraph_node_set set) in reachable_from_other_partition_p() argument
354 if (!node->analyzed) in reachable_from_other_partition_p()
356 if (node->global.inlined_to) in reachable_from_other_partition_p()
358 for (e = node->callers; e; e = e->next_caller) in reachable_from_other_partition_p()
393 reachable_from_this_partition_p (struct cgraph_node *node, cgraph_node_set set) in reachable_from_this_partition_p() argument
396 for (e = node->callers; e; e = e->next_caller) in reachable_from_this_partition_p()
411 lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, in lto_output_node() argument
422 boundary_p = !cgraph_node_in_set_p (node, set); in lto_output_node()
424 if (node->analyzed && !boundary_p) in lto_output_node()
431 streamer_write_hwi_stream (ob->main_stream, node->order); in lto_output_node()
443 if (boundary_p && node->analyzed) in lto_output_node()
456 clone_of = node->clone_of; in lto_output_node()
465 gcc_assert (clone_of || !node->clone_of); in lto_output_node()
472 lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->decl); in lto_output_node()
473 streamer_write_hwi_stream (ob->main_stream, node->count); in lto_output_node()
474 streamer_write_hwi_stream (ob->main_stream, node->count_materialization_scale); in lto_output_node()
478 if (node->global.inlined_to) in lto_output_node()
480 ref = lto_cgraph_encoder_lookup (encoder, node->global.inlined_to); in lto_output_node()
489 if (node->same_comdat_group && !boundary_p) in lto_output_node()
491 ref = lto_cgraph_encoder_lookup (encoder, node->same_comdat_group); in lto_output_node()
499 bp_pack_value (&bp, node->local.local, 1); in lto_output_node()
500 bp_pack_value (&bp, node->local.externally_visible, 1); in lto_output_node()
501 bp_pack_value (&bp, node->local.finalized, 1); in lto_output_node()
502 bp_pack_value (&bp, node->local.versionable, 1); in lto_output_node()
503 bp_pack_value (&bp, node->local.can_change_signature, 1); in lto_output_node()
504 bp_pack_value (&bp, node->local.redefined_extern_inline, 1); in lto_output_node()
505 bp_pack_value (&bp, node->needed, 1); in lto_output_node()
506 bp_pack_value (&bp, node->address_taken, 1); in lto_output_node()
507 bp_pack_value (&bp, node->abstract_and_needed, 1); in lto_output_node()
509 && !DECL_EXTERNAL (node->decl) in lto_output_node()
510 && !DECL_COMDAT (node->decl) in lto_output_node()
511 && (reachable_from_other_partition_p (node, set) in lto_output_node()
512 || referenced_from_other_partition_p (&node->ref_list, set, vset)), 1); in lto_output_node()
513 bp_pack_value (&bp, node->lowered, 1); in lto_output_node()
521 bp_pack_value (&bp, node->alias && (!boundary_p || DECL_EXTERNAL (node->decl)), 1); in lto_output_node()
522 bp_pack_value (&bp, node->frequency, 2); in lto_output_node()
523 bp_pack_value (&bp, node->only_called_at_startup, 1); in lto_output_node()
524 bp_pack_value (&bp, node->only_called_at_exit, 1); in lto_output_node()
525 bp_pack_value (&bp, node->tm_clone, 1); in lto_output_node()
526 bp_pack_value (&bp, node->thunk.thunk_p && !boundary_p, 1); in lto_output_node()
528 LDPR_NUM_KNOWN, node->resolution); in lto_output_node()
531 if (node->thunk.thunk_p && !boundary_p) in lto_output_node()
535 1 + (node->thunk.this_adjusting != 0) * 2 in lto_output_node()
536 + (node->thunk.virtual_offset_p != 0) * 4); in lto_output_node()
537 streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset); in lto_output_node()
538 streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value); in lto_output_node()
540 if ((node->alias || node->thunk.thunk_p) in lto_output_node()
541 && (!boundary_p || (node->alias && DECL_EXTERNAL (node->decl)))) in lto_output_node()
544 node->thunk.alias != NULL); in lto_output_node()
545 if (node->thunk.alias != NULL) in lto_output_node()
547 node->thunk.alias); in lto_output_node()
555 lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node *node, in lto_output_varpool_node() argument
559 bool boundary_p = !varpool_node_in_set_p (node, vset) && node->analyzed; in lto_output_varpool_node()
563 streamer_write_hwi_stream (ob->main_stream, node->order); in lto_output_varpool_node()
564 lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->decl); in lto_output_varpool_node()
566 bp_pack_value (&bp, node->externally_visible, 1); in lto_output_varpool_node()
567 bp_pack_value (&bp, node->force_output, 1); in lto_output_varpool_node()
568 bp_pack_value (&bp, node->finalized, 1); in lto_output_varpool_node()
569 bp_pack_value (&bp, node->alias, 1); in lto_output_varpool_node()
570 bp_pack_value (&bp, node->alias_of != NULL, 1); in lto_output_varpool_node()
571 gcc_assert (node->finalized || !node->analyzed); in lto_output_varpool_node()
572 gcc_assert (node->needed); in lto_output_varpool_node()
576 if (DECL_IN_CONSTANT_POOL (node->decl) in lto_output_varpool_node()
577 && !DECL_COMDAT (node->decl)) in lto_output_varpool_node()
584 bp_pack_value (&bp, node->analyzed in lto_output_varpool_node()
585 && referenced_from_other_partition_p (&node->ref_list, in lto_output_varpool_node()
590 if (node->alias_of) in lto_output_varpool_node()
591 lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->alias_of); in lto_output_varpool_node()
592 if (node->same_comdat_group && !boundary_p) in lto_output_varpool_node()
594 ref = lto_varpool_encoder_lookup (varpool_encoder, node->same_comdat_group); in lto_output_varpool_node()
601 LDPR_NUM_KNOWN, node->resolution); in lto_output_varpool_node()
654 add_node_to (lto_cgraph_encoder_t encoder, struct cgraph_node *node, in add_node_to() argument
657 if (node->clone_of) in add_node_to()
658 add_node_to (encoder, node->clone_of, include_body); in add_node_to()
660 lto_set_cgraph_encoder_encode_body (encoder, node); in add_node_to()
661 lto_cgraph_encoder_encode (encoder, node); in add_node_to()
720 struct cgraph_node *node = csi_node (csi); in output_refs() local
722 count = ipa_ref_list_nreferences (&node->ref_list); in output_refs()
727 lto_cgraph_encoder_lookup (encoder, node)); in output_refs()
728 for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++) in output_refs()
737 struct varpool_node *node = vsi_node (vsi); in output_refs() local
739 count = ipa_ref_list_nreferences (&node->ref_list); in output_refs()
745 node)); in output_refs()
746 for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++) in output_refs()
762 struct cgraph_node *node; in compute_ltrans_boundary() local
776 node = csi_node (csi); in compute_ltrans_boundary()
777 add_node_to (encoder, node, true); in compute_ltrans_boundary()
778 add_references (encoder, varpool_encoder, &node->ref_list); in compute_ltrans_boundary()
808 node = csi_node (csi); in compute_ltrans_boundary()
809 for (edge = node->callees; edge; edge = edge->next_callee) in compute_ltrans_boundary()
827 struct cgraph_node *node; in output_cgraph() local
855 node = lto_cgraph_encoder_deref (encoder, i); in output_cgraph()
856 lto_output_node (ob, node, encoder, set, vset); in output_cgraph()
862 node = csi_node (csi); in output_cgraph()
863 output_outgoing_cgraph_edges (node->callees, ob, encoder); in output_cgraph()
864 output_outgoing_cgraph_edges (node->indirect_calls, ob, encoder); in output_cgraph()
894 struct cgraph_node *node, in input_overwrite_node() argument
898 node->aux = (void *) tag; in input_overwrite_node()
899 node->local.lto_file_data = file_data; in input_overwrite_node()
901 node->local.local = bp_unpack_value (bp, 1); in input_overwrite_node()
902 node->local.externally_visible = bp_unpack_value (bp, 1); in input_overwrite_node()
903 node->local.finalized = bp_unpack_value (bp, 1); in input_overwrite_node()
904 node->local.versionable = bp_unpack_value (bp, 1); in input_overwrite_node()
905 node->local.can_change_signature = bp_unpack_value (bp, 1); in input_overwrite_node()
906 node->local.redefined_extern_inline = bp_unpack_value (bp, 1); in input_overwrite_node()
907 node->needed = bp_unpack_value (bp, 1); in input_overwrite_node()
908 node->address_taken = bp_unpack_value (bp, 1); in input_overwrite_node()
909 node->abstract_and_needed = bp_unpack_value (bp, 1); in input_overwrite_node()
910 node->reachable_from_other_partition = bp_unpack_value (bp, 1); in input_overwrite_node()
911 node->lowered = bp_unpack_value (bp, 1); in input_overwrite_node()
912 node->analyzed = tag == LTO_cgraph_analyzed_node; in input_overwrite_node()
913 node->in_other_partition = bp_unpack_value (bp, 1); in input_overwrite_node()
914 if (node->in_other_partition in input_overwrite_node()
922 && (!node->clone_of in input_overwrite_node()
923 || node->clone_of->decl != node->decl)) in input_overwrite_node()
925 DECL_EXTERNAL (node->decl) = 1; in input_overwrite_node()
926 TREE_STATIC (node->decl) = 0; in input_overwrite_node()
928 node->alias = bp_unpack_value (bp, 1); in input_overwrite_node()
929 node->frequency = (enum node_frequency)bp_unpack_value (bp, 2); in input_overwrite_node()
930 node->only_called_at_startup = bp_unpack_value (bp, 1); in input_overwrite_node()
931 node->only_called_at_exit = bp_unpack_value (bp, 1); in input_overwrite_node()
932 node->tm_clone = bp_unpack_value (bp, 1); in input_overwrite_node()
933 node->thunk.thunk_p = bp_unpack_value (bp, 1); in input_overwrite_node()
934 node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution, in input_overwrite_node()
972 struct cgraph_node *node; in input_node() local
987 node = cgraph_clone_node (VEC_index (cgraph_node_ptr, nodes, clone_ref), fn_decl, in input_node()
991 node = cgraph_get_create_node (fn_decl); in input_node()
993 node->order = order; in input_node()
997 node->count = streamer_read_hwi (ib); in input_node()
998 node->count_materialization_scale = streamer_read_hwi (ib); in input_node()
1009 if (node->aux && !DECL_BUILT_IN (node->decl)) in input_node()
1011 "node %d", node->uid); in input_node()
1014 input_overwrite_node (file_data, node, tag, &bp); in input_node()
1017 node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref; in input_node()
1020 node->same_comdat_group = (cgraph_node_ptr) (intptr_t) ref2; in input_node()
1022 if (node->thunk.thunk_p) in input_node()
1028 node->thunk.fixed_offset = fixed_offset; in input_node()
1029 node->thunk.this_adjusting = (type & 2); in input_node()
1030 node->thunk.virtual_value = virtual_value; in input_node()
1031 node->thunk.virtual_offset_p = (type & 4); in input_node()
1033 if (node->thunk.thunk_p || node->alias) in input_node()
1038 node->thunk.alias = lto_file_decl_data_get_fn_decl (file_data, in input_node()
1042 return node; in input_node()
1054 struct varpool_node *node; in input_varpool_node() local
1063 node = varpool_node (var_decl); in input_varpool_node()
1064 node->order = order; in input_varpool_node()
1067 node->lto_file_data = file_data; in input_varpool_node()
1070 node->externally_visible = bp_unpack_value (&bp, 1); in input_varpool_node()
1071 node->force_output = bp_unpack_value (&bp, 1); in input_varpool_node()
1072 node->finalized = bp_unpack_value (&bp, 1); in input_varpool_node()
1073 node->alias = bp_unpack_value (&bp, 1); in input_varpool_node()
1075 node->analyzed = node->finalized; in input_varpool_node()
1076 node->used_from_other_partition = bp_unpack_value (&bp, 1); in input_varpool_node()
1077 node->in_other_partition = bp_unpack_value (&bp, 1); in input_varpool_node()
1078 if (node->in_other_partition) in input_varpool_node()
1080 DECL_EXTERNAL (node->decl) = 1; in input_varpool_node()
1081 TREE_STATIC (node->decl) = 0; in input_varpool_node()
1083 if (node->finalized) in input_varpool_node()
1084 varpool_mark_needed_node (node); in input_varpool_node()
1088 node->alias_of = lto_file_decl_data_get_var_decl (file_data, decl_index); in input_varpool_node()
1092 node->same_comdat_group = (struct varpool_node *) (intptr_t) ref; in input_varpool_node()
1093 node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution, in input_varpool_node()
1096 return node; in input_varpool_node()
1109 struct cgraph_node *node = NULL; in input_ref() local
1119 node = VEC_index (cgraph_node_ptr, nodes, streamer_read_hwi (ib)); in input_ref()
1124 node, varpool_node, use, NULL); in input_ref()
1202 struct cgraph_node *node; in VEC() local
1215 node = input_node (file_data, ib, tag,nodes); in VEC()
1216 if (node == NULL || node->decl == NULL_TREE) in VEC()
1218 VEC_safe_push (cgraph_node_ptr, heap, nodes, node); in VEC()
1219 lto_cgraph_encoder_encode (file_data->cgraph_node_encoder, node); in VEC()
1229 FOR_EACH_VEC_ELT (cgraph_node_ptr, nodes, i, node) in VEC()
1230 gcc_assert (node->aux); in VEC()
1232 FOR_EACH_VEC_ELT (cgraph_node_ptr, nodes, i, node) in VEC()
1234 int ref = (int) (intptr_t) node->global.inlined_to; in VEC()
1237 if (!node->aux) in VEC()
1239 node->aux = NULL; in VEC()
1243 node->global.inlined_to = VEC_index (cgraph_node_ptr, nodes, ref); in VEC()
1245 node->global.inlined_to = NULL; in VEC()
1247 ref = (int) (intptr_t) node->same_comdat_group; in VEC()
1251 node->same_comdat_group = VEC_index (cgraph_node_ptr, nodes, ref); in VEC()
1253 node->same_comdat_group = NULL; in VEC()
1255 FOR_EACH_VEC_ELT (cgraph_node_ptr, nodes, i, node) in VEC()
1256 node->aux = (void *)1; in VEC()
1269 struct varpool_node *node; in VEC() local
1279 FOR_EACH_VEC_ELT (varpool_node_ptr, varpool, i, node) in VEC()
1280 gcc_assert (!node->aux); in VEC()
1282 FOR_EACH_VEC_ELT (varpool_node_ptr, varpool, i, node) in VEC()
1284 int ref = (int) (intptr_t) node->same_comdat_group; in VEC()
1286 if (node->aux) in VEC()
1288 node->aux = (void *)1; in VEC()
1292 node->same_comdat_group = VEC_index (varpool_node_ptr, varpool, ref); in VEC()
1294 node->same_comdat_group = NULL; in VEC()
1296 FOR_EACH_VEC_ELT (varpool_node_ptr, varpool, i, node) in VEC()
1297 node->aux = NULL; in VEC()
1312 struct cgraph_node *node; in input_refs() local
1317 node = VEC_index (cgraph_node_ptr, nodes, idx); in input_refs()
1320 input_ref (ib, node, NULL, nodes, varpool); in input_refs()
1326 struct varpool_node *node; in input_refs() local
1330 node = VEC_index (varpool_node_ptr, varpool, in input_refs()
1334 input_ref (ib, NULL, node, nodes, varpool); in input_refs()
1365 struct cgraph_node *node; in merge_profile_summaries() local
1418 for (node = cgraph_nodes; node; node = node->next) in merge_profile_summaries()
1419 if (node->local.lto_file_data in merge_profile_summaries()
1420 && node->local.lto_file_data->profile_info.runs) in merge_profile_summaries()
1425 ((node->count_materialization_scale * max_runs in merge_profile_summaries()
1426 + node->local.lto_file_data->profile_info.runs / 2) in merge_profile_summaries()
1427 / node->local.lto_file_data->profile_info.runs); in merge_profile_summaries()
1428 node->count_materialization_scale = scale; in merge_profile_summaries()
1435 for (edge = node->callees; edge; edge = edge->next_callee) in merge_profile_summaries()
1438 node->count = ((node->count * scale + REG_BR_PROB_BASE / 2) in merge_profile_summaries()
1452 struct cgraph_node *node; in input_cgraph() local
1497 for (node = cgraph_nodes; node; node = node->next) in input_cgraph()
1504 if (node->local.lto_file_data) in input_cgraph()
1505 node->aux = NULL; in input_cgraph()
1512 output_cgraph_opt_summary_p (struct cgraph_node *node, in output_cgraph_opt_summary_p() argument
1515 return (node->clone_of in output_cgraph_opt_summary_p()
1516 && (node->clone.tree_map in output_cgraph_opt_summary_p()
1517 || node->clone.args_to_skip in output_cgraph_opt_summary_p()
1518 || node->clone.combined_args_to_skip)); in output_cgraph_opt_summary_p()
1532 struct cgraph_node *node, in output_node_opt_summary() argument
1542 if (node->clone.args_to_skip) in output_node_opt_summary()
1544 streamer_write_uhwi (ob, bitmap_count_bits (node->clone.args_to_skip)); in output_node_opt_summary()
1545 EXECUTE_IF_SET_IN_BITMAP (node->clone.args_to_skip, 0, index, bi) in output_node_opt_summary()
1550 if (node->clone.combined_args_to_skip) in output_node_opt_summary()
1552 streamer_write_uhwi (ob, bitmap_count_bits (node->clone.combined_args_to_skip)); in output_node_opt_summary()
1553 EXECUTE_IF_SET_IN_BITMAP (node->clone.combined_args_to_skip, 0, index, bi) in output_node_opt_summary()
1559 node->clone.tree_map)); in output_node_opt_summary()
1560 FOR_EACH_VEC_ELT (ipa_replace_map_p, node->clone.tree_map, i, map) in output_node_opt_summary()
1565 for (parm_num = 0, parm = DECL_ARGUMENTS (node->decl); parm; in output_node_opt_summary()
1580 if (cgraph_node_in_set_p (node, set)) in output_node_opt_summary()
1582 for (e = node->callees; e; e = e->next_callee) in output_node_opt_summary()
1584 for (e = node->indirect_calls; e; e = e->next_callee) in output_node_opt_summary()
1595 struct cgraph_node *node; in output_cgraph_opt_summary() local
1611 node = lto_cgraph_encoder_deref (encoder, i); in output_cgraph_opt_summary()
1612 if (output_cgraph_opt_summary_p (node, set)) in output_cgraph_opt_summary()
1615 output_node_opt_summary (ob, node, set); in output_cgraph_opt_summary()
1633 input_node_opt_summary (struct cgraph_node *node, in input_node_opt_summary() argument
1645 node->clone.args_to_skip = BITMAP_GGC_ALLOC (); in input_node_opt_summary()
1649 bitmap_set_bit (node->clone.args_to_skip, bit); in input_node_opt_summary()
1653 node->clone.combined_args_to_skip = BITMAP_GGC_ALLOC (); in input_node_opt_summary()
1657 bitmap_set_bit (node->clone.combined_args_to_skip, bit); in input_node_opt_summary()
1666 VEC_safe_push (ipa_replace_map_p, gc, node->clone.tree_map, map); in input_node_opt_summary()
1667 for (parm_num = 0, parm = DECL_ARGUMENTS (node->decl); parm_num; in input_node_opt_summary()
1677 for (e = node->callees; e; e = e->next_callee) in input_node_opt_summary()
1679 for (e = node->indirect_calls; e; e = e->next_callee) in input_node_opt_summary()