2009-10-03 23:10:11 +02:00
|
|
|
/* Miscellaneous utilities for GIMPLE streaming. Things that are used
|
|
|
|
in both input and output are here.
|
|
|
|
|
2014-01-02 23:23:26 +01:00
|
|
|
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
2009-10-03 23:10:11 +02:00
|
|
|
Contributed by Doug Kwan <dougkwan@google.com>
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
|
|
|
#include "toplev.h"
|
|
|
|
#include "flags.h"
|
|
|
|
#include "tree.h"
|
2014-10-27 13:41:01 +01:00
|
|
|
#include "predict.h"
|
|
|
|
#include "vec.h"
|
|
|
|
#include "hashtab.h"
|
|
|
|
#include "hash-set.h"
|
|
|
|
#include "machmode.h"
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "function.h"
|
2013-11-22 16:58:51 +01:00
|
|
|
#include "basic-block.h"
|
|
|
|
#include "tree-ssa-alias.h"
|
|
|
|
#include "internal-fn.h"
|
|
|
|
#include "gimple-expr.h"
|
|
|
|
#include "is-a.h"
|
2013-10-29 13:55:50 +01:00
|
|
|
#include "gimple.h"
|
2009-10-03 23:10:11 +02:00
|
|
|
#include "bitmap.h"
|
2013-10-23 14:16:58 +02:00
|
|
|
#include "diagnostic-core.h"
|
2014-10-28 17:17:19 +01:00
|
|
|
#include "hash-map.h"
|
|
|
|
#include "plugin-api.h"
|
|
|
|
#include "ipa-ref.h"
|
|
|
|
#include "cgraph.h"
|
2011-08-08 18:49:34 +02:00
|
|
|
#include "tree-streamer.h"
|
2009-10-03 23:10:11 +02:00
|
|
|
#include "lto-streamer.h"
|
2014-05-22 18:21:18 +02:00
|
|
|
#include "lto-section-names.h"
|
2011-08-08 18:49:34 +02:00
|
|
|
#include "streamer-hooks.h"
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
/* Statistics gathered during LTO, WPA and LTRANS. */
|
|
|
|
struct lto_stats_d lto_stats;
|
|
|
|
|
2012-05-29 16:14:06 +02:00
|
|
|
/* LTO uses bitmaps with different life-times. So use a separate
|
2009-10-03 23:10:11 +02:00
|
|
|
obstack for all LTO bitmaps. */
|
|
|
|
static bitmap_obstack lto_obstack;
|
|
|
|
static bool lto_obstack_initialized;
|
|
|
|
|
2014-11-13 14:37:38 +01:00
|
|
|
const char *section_name_prefix = LTO_SECTION_NAME_PREFIX;
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
/* Return a string representing LTO tag TAG. */
|
|
|
|
|
|
|
|
const char *
|
|
|
|
lto_tag_name (enum LTO_tags tag)
|
|
|
|
{
|
|
|
|
if (lto_tag_is_tree_code_p (tag))
|
|
|
|
{
|
|
|
|
/* For tags representing tree nodes, return the name of the
|
|
|
|
associated tree code. */
|
tree-core.h (tree_code_name): Remove.
gcc/
* tree-core.h (tree_code_name): Remove.
* tree.h (get_tree_code_name): New prototype.
* tree.c (tree_code_name): Make static.
(get_tree_code_name): New function.
(dump_tree_statistics, tree_check_failed, tree_not_check_failed,
tree_class_check_failed, tree_range_check_failed,
tree_not_class_check_failed, omp_clause_check_failed,
tree_contains_struct_check_failed, tree_operand_check_failed): Use new
wrapper get_tree_code_name instead of calling tree_code_name directly.
* tree-vrp.c (dump_asserts_for): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-pretty-print.c (do_niy, dump_generic_node): Likewise.
* tree-pretty-print.h (pp_unsupported_tree): Likewise.
* lto-streamer-out.c (lto_write_tree, DFS_write_tree): Likewise.
* tree-ssa-dom.c (print_expr_hash_elt): Likewise.
* gimple-pretty-print.c (dump_unary_rhs, dump_binary_rhs,
dump_ternary_rhs, dump_gimple_assign, dump_gimple_cond,
dump_gimple_omp_for): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
* tree-ssa-pre.c (print_pre_expr): Likewise.
* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* gimple.c (gimple_check_failed): Likewise.
* lto-streamer.c (lto_tag_name, print_lto_report): Likewise.
* config/frv/frv.c (frv_init_cumulative_args): Likewise.
* config/mep/mep.c (mep_validate_vliw): Likewise.
* config/iq2000/iq2000.c (init_cumulative_args): Likewise.
* config/rs6000/rs6000.c (init_cumulative_args): Likewise.
gcc/cp/
* error.c (code_to_string): Use new wrapper get_tree_code_name.
* cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
* pt.c (tsubst): Likewise.
* semantics.c (cxx_eval_constant_expression,
potential_constant_expression_1): Likewise.
* mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
add_substitution, find_substitution): Likewise.
From-SVN: r203695
2013-10-16 12:09:17 +02:00
|
|
|
return get_tree_code_name (lto_tag_to_tree_code (tag));
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (lto_tag_is_gimple_code_p (tag))
|
|
|
|
{
|
|
|
|
/* For tags representing gimple statements, return the name of
|
|
|
|
the associated gimple code. */
|
|
|
|
return gimple_code_name[lto_tag_to_gimple_code (tag)];
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (tag)
|
|
|
|
{
|
|
|
|
case LTO_null:
|
|
|
|
return "LTO_null";
|
|
|
|
case LTO_bb0:
|
|
|
|
return "LTO_bb0";
|
|
|
|
case LTO_bb1:
|
|
|
|
return "LTO_bb1";
|
|
|
|
case LTO_eh_region:
|
|
|
|
return "LTO_eh_region";
|
|
|
|
case LTO_function:
|
|
|
|
return "LTO_function";
|
|
|
|
case LTO_eh_table:
|
|
|
|
return "LTO_eh_table";
|
|
|
|
case LTO_ert_cleanup:
|
|
|
|
return "LTO_ert_cleanup";
|
|
|
|
case LTO_ert_try:
|
|
|
|
return "LTO_ert_try";
|
|
|
|
case LTO_ert_allowed_exceptions:
|
|
|
|
return "LTO_ert_allowed_exceptions";
|
|
|
|
case LTO_ert_must_not_throw:
|
|
|
|
return "LTO_ert_must_not_throw";
|
|
|
|
case LTO_tree_pickle_reference:
|
|
|
|
return "LTO_tree_pickle_reference";
|
|
|
|
case LTO_field_decl_ref:
|
|
|
|
return "LTO_field_decl_ref";
|
|
|
|
case LTO_function_decl_ref:
|
|
|
|
return "LTO_function_decl_ref";
|
|
|
|
case LTO_label_decl_ref:
|
|
|
|
return "LTO_label_decl_ref";
|
|
|
|
case LTO_namespace_decl_ref:
|
|
|
|
return "LTO_namespace_decl_ref";
|
|
|
|
case LTO_result_decl_ref:
|
|
|
|
return "LTO_result_decl_ref";
|
|
|
|
case LTO_ssa_name_ref:
|
|
|
|
return "LTO_ssa_name_ref";
|
|
|
|
case LTO_type_decl_ref:
|
|
|
|
return "LTO_type_decl_ref";
|
|
|
|
case LTO_type_ref:
|
|
|
|
return "LTO_type_ref";
|
|
|
|
case LTO_global_decl_ref:
|
|
|
|
return "LTO_global_decl_ref";
|
|
|
|
default:
|
|
|
|
return "LTO_UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Allocate a bitmap from heap. Initializes the LTO obstack if necessary. */
|
|
|
|
|
|
|
|
bitmap
|
|
|
|
lto_bitmap_alloc (void)
|
|
|
|
{
|
|
|
|
if (!lto_obstack_initialized)
|
|
|
|
{
|
|
|
|
bitmap_obstack_initialize (<o_obstack);
|
|
|
|
lto_obstack_initialized = true;
|
|
|
|
}
|
|
|
|
return BITMAP_ALLOC (<o_obstack);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free bitmap B. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_bitmap_free (bitmap b)
|
|
|
|
{
|
|
|
|
BITMAP_FREE (b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Get a section name for a particular type or name. The NAME field
|
2010-07-23 07:33:51 +02:00
|
|
|
is only used if SECTION_TYPE is LTO_section_function_body. For all
|
|
|
|
others it is ignored. The callee of this function is responsible
|
|
|
|
to free the returned name. */
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
char *
|
2010-07-23 07:33:51 +02:00
|
|
|
lto_get_section_name (int section_type, const char *name, struct lto_file_decl_data *f)
|
2009-10-03 23:10:11 +02:00
|
|
|
{
|
2010-07-23 07:33:51 +02:00
|
|
|
const char *add;
|
|
|
|
char post[32];
|
|
|
|
const char *sep;
|
|
|
|
|
|
|
|
if (section_type == LTO_section_function_body)
|
2009-10-03 23:10:11 +02:00
|
|
|
{
|
2010-01-01 17:49:15 +01:00
|
|
|
gcc_assert (name != NULL);
|
|
|
|
if (name[0] == '*')
|
|
|
|
name++;
|
2010-07-23 07:33:51 +02:00
|
|
|
add = name;
|
|
|
|
sep = "";
|
|
|
|
}
|
|
|
|
else if (section_type < LTO_N_SECTION_TYPES)
|
|
|
|
{
|
|
|
|
add = lto_section_name[section_type];
|
|
|
|
sep = ".";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
internal_error ("bytecode stream: unexpected LTO section %s", name);
|
2009-10-03 23:10:11 +02:00
|
|
|
|
2010-07-23 07:33:51 +02:00
|
|
|
/* Make the section name unique so that ld -r combining sections
|
|
|
|
doesn't confuse the reader with merged sections.
|
2009-10-03 23:10:11 +02:00
|
|
|
|
2010-07-23 07:33:51 +02:00
|
|
|
For options don't add a ID, the option reader cannot deal with them
|
2011-09-29 15:14:51 +02:00
|
|
|
and merging should be ok here. */
|
2010-07-23 07:33:51 +02:00
|
|
|
if (section_type == LTO_section_opts)
|
|
|
|
strcpy (post, "");
|
2011-09-29 15:14:51 +02:00
|
|
|
else if (f != NULL)
|
|
|
|
sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, f->id);
|
2010-07-23 07:33:51 +02:00
|
|
|
else
|
2011-09-29 15:14:51 +02:00
|
|
|
sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, get_random_seed (false));
|
2014-11-13 14:37:38 +01:00
|
|
|
return concat (section_name_prefix, sep, add, post, NULL);
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Show various memory usage statistics related to LTO. */
|
|
|
|
|
|
|
|
void
|
gimple.h (gimple_register_type): Remove.
2012-09-11 Richard Guenther <rguenther@suse.de>
* gimple.h (gimple_register_type): Remove.
(print_gimple_types_stats): Adjust prototype.
* lto-streamer.h (print_lto_report): Likewise.
* lto-streamer.c (print_lto_report): Adjust.
* gimple.c (gimple_types, type_hash_cache, enum gtc_mode,
struct type_pair_d, lookup_type_pair, struct sccs,
next_dfs_num, gtc_next_dfs_num, struct gimple_type_leader_entry_s,
gimple_type_leader, gimple_lookup_type_leader, compare_type_names_p,
gtc_visit, gimple_types_compatible_p_1, gimple_types_compatible_p,
visit, iterative_hash_name, struct type_hash_pair,
type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
gimple_type_eq, gimple_register_type_1, gimple_register_type):
Move to lto/lto.c.
(print_gimple_types_stats): Adjust.
(free_gimple_type_tables): Likewise.
lto/
* lto.c (gimple_types, type_hash_cache, enum gtc_mode,
struct type_pair_d, lookup_type_pair, struct sccs,
next_dfs_num, gtc_next_dfs_num, struct gimple_type_leader_entry_s,
gimple_type_leader, gimple_lookup_type_leader, compare_type_names_p,
gtc_visit, gimple_types_compatible_p_1, gimple_types_compatible_p,
visit, iterative_hash_name, struct type_hash_pair,
type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
gimple_type_eq, gimple_register_type_1, gimple_register_type):
Move here from gimple.c
(read_cgraph_and_symbols): Free hash tables here.
(print_lto_report_1): New function wrapping print_lto_report.
(do_whole_program_analysis): Call it.
(lto_main): Likewise.
From-SVN: r191177
2012-09-11 13:39:27 +02:00
|
|
|
print_lto_report (const char *s)
|
2009-10-03 23:10:11 +02:00
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
fprintf (stderr, "[%s] # of input files: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s, lto_stats.num_input_files);
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (stderr, "[%s] # of input cgraph nodes: "
|
2009-10-03 23:10:11 +02:00
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_input_cgraph_nodes);
|
|
|
|
|
|
|
|
fprintf (stderr, "[%s] # of function bodies: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_function_bodies);
|
|
|
|
|
|
|
|
for (i = 0; i < NUM_TREE_CODES; i++)
|
|
|
|
if (lto_stats.num_trees[i])
|
|
|
|
fprintf (stderr, "[%s] # of '%s' objects read: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
tree-core.h (tree_code_name): Remove.
gcc/
* tree-core.h (tree_code_name): Remove.
* tree.h (get_tree_code_name): New prototype.
* tree.c (tree_code_name): Make static.
(get_tree_code_name): New function.
(dump_tree_statistics, tree_check_failed, tree_not_check_failed,
tree_class_check_failed, tree_range_check_failed,
tree_not_class_check_failed, omp_clause_check_failed,
tree_contains_struct_check_failed, tree_operand_check_failed): Use new
wrapper get_tree_code_name instead of calling tree_code_name directly.
* tree-vrp.c (dump_asserts_for): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-pretty-print.c (do_niy, dump_generic_node): Likewise.
* tree-pretty-print.h (pp_unsupported_tree): Likewise.
* lto-streamer-out.c (lto_write_tree, DFS_write_tree): Likewise.
* tree-ssa-dom.c (print_expr_hash_elt): Likewise.
* gimple-pretty-print.c (dump_unary_rhs, dump_binary_rhs,
dump_ternary_rhs, dump_gimple_assign, dump_gimple_cond,
dump_gimple_omp_for): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
* tree-ssa-pre.c (print_pre_expr): Likewise.
* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* gimple.c (gimple_check_failed): Likewise.
* lto-streamer.c (lto_tag_name, print_lto_report): Likewise.
* config/frv/frv.c (frv_init_cumulative_args): Likewise.
* config/mep/mep.c (mep_validate_vliw): Likewise.
* config/iq2000/iq2000.c (init_cumulative_args): Likewise.
* config/rs6000/rs6000.c (init_cumulative_args): Likewise.
gcc/cp/
* error.c (code_to_string): Use new wrapper get_tree_code_name.
* cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
* pt.c (tsubst): Likewise.
* semantics.c (cxx_eval_constant_expression,
potential_constant_expression_1): Likewise.
* mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
add_substitution, find_substitution): Likewise.
From-SVN: r203695
2013-10-16 12:09:17 +02:00
|
|
|
get_tree_code_name ((enum tree_code) i), lto_stats.num_trees[i]);
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
if (flag_lto)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "[%s] Compression: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED " output bytes, "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED " compressed bytes", s,
|
|
|
|
lto_stats.num_output_il_bytes,
|
|
|
|
lto_stats.num_compressed_il_bytes);
|
|
|
|
if (lto_stats.num_output_il_bytes > 0)
|
|
|
|
{
|
|
|
|
const float dividend = (float) lto_stats.num_compressed_il_bytes;
|
|
|
|
const float divisor = (float) lto_stats.num_output_il_bytes;
|
|
|
|
fprintf (stderr, " (ratio: %f)", dividend / divisor);
|
|
|
|
}
|
|
|
|
fprintf (stderr, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag_wpa)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "[%s] # of output files: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_output_files);
|
|
|
|
|
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder in partitioning.
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder
in partitioning.
* tree-pass.h (cgraph_node_set_def, varpool_node_set_def): Remove
forward declaration.
(lto_symtab_encoder_d): Forward declare.
(ipa_write_optimization_summaries): Update.
* lto-cgraph.c (lto_symtab_encoder_new): Do not initialize
body, initializer and in_partition.
(lto_symtab_encoder_delete): Update.
(lto_symtab_encoder_encode): Update.
(lto_symtab_encoder_lookup): Move inline.
(lto_symtab_encoder_delete_node): New function.
(lto_symtab_encoder_encode_body_p, lto_set_symtab_encoder_encode_body,
lto_symtab_encoder_encode_initializer_p,
lto_set_symtab_encoder_encode_initializer, lto_symtab_encoder_in_partition_p,
lto_symtab_encoder_in_partition_p): Update.
(compute_ltrans_boundary): Take encoder as an input.
* passes.c (ipa_write_summaries_1): Update.
(ipa_write_summaries_1): Update.
(ipa_write_summaries): Update.
(ipa_write_optimization_summaries): Update.
* lto-streamer.c (print_lto_report): Report number of cgraph nodes.
* lto-streamer.h (lto_stats_d): Replace num_output_cgraph_nodes by
num_output_symtab_nodes.
(lto_encoder_entry): New structure.
(struct lto_symtab_encoder_d): Reorg.
(lto_symtab_encoder_delete_node): Declare.
(lto_symtab_encoder_lookup): Bring inline.
(compute_ltrans_boundary): Update.
(lto_symtab_encoder_size): Update.
(lsei_node, lsei_cgraph_node, lsei_varpool_node): Update.
(lto_symtab_encoder_deref): Update.
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder
in partitioning.
* lto-partition.h (ltrans_partition_def): Replace cgraph_set and varpool_set
by encoder.
* lto-partition.c (new_partition): Update.
* lto.c (cmp_partitions_order): Update.
(lto_wpa_write_files): Update.
(free_ltrans_partitions): Update.
(add_references_to_partition): Update.
(add_cgraph_node_to_partition_1): Update.
(add_cgraph_node_to_partition): Update.
(add_varpool_node_to_partition): Update.
(undo_partition): Update.
(lto_balanced_map): Update.
(set_referenced_from_other_partition_p, set_reachable_from_other_partition_p,
set_referenced_from_this_partition_p): Update.
(lto_promote_cross_file_statics): Update.
From-SVN: r191107
2012-09-09 14:31:32 +02:00
|
|
|
fprintf (stderr, "[%s] # of output symtab nodes: "
|
2009-10-03 23:10:11 +02:00
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder in partitioning.
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder
in partitioning.
* tree-pass.h (cgraph_node_set_def, varpool_node_set_def): Remove
forward declaration.
(lto_symtab_encoder_d): Forward declare.
(ipa_write_optimization_summaries): Update.
* lto-cgraph.c (lto_symtab_encoder_new): Do not initialize
body, initializer and in_partition.
(lto_symtab_encoder_delete): Update.
(lto_symtab_encoder_encode): Update.
(lto_symtab_encoder_lookup): Move inline.
(lto_symtab_encoder_delete_node): New function.
(lto_symtab_encoder_encode_body_p, lto_set_symtab_encoder_encode_body,
lto_symtab_encoder_encode_initializer_p,
lto_set_symtab_encoder_encode_initializer, lto_symtab_encoder_in_partition_p,
lto_symtab_encoder_in_partition_p): Update.
(compute_ltrans_boundary): Take encoder as an input.
* passes.c (ipa_write_summaries_1): Update.
(ipa_write_summaries_1): Update.
(ipa_write_summaries): Update.
(ipa_write_optimization_summaries): Update.
* lto-streamer.c (print_lto_report): Report number of cgraph nodes.
* lto-streamer.h (lto_stats_d): Replace num_output_cgraph_nodes by
num_output_symtab_nodes.
(lto_encoder_entry): New structure.
(struct lto_symtab_encoder_d): Reorg.
(lto_symtab_encoder_delete_node): Declare.
(lto_symtab_encoder_lookup): Bring inline.
(compute_ltrans_boundary): Update.
(lto_symtab_encoder_size): Update.
(lsei_node, lsei_cgraph_node, lsei_varpool_node): Update.
(lto_symtab_encoder_deref): Update.
Replace cgraph_node_set and varpool_node_set by symtab_node_encoder
in partitioning.
* lto-partition.h (ltrans_partition_def): Replace cgraph_set and varpool_set
by encoder.
* lto-partition.c (new_partition): Update.
* lto.c (cmp_partitions_order): Update.
(lto_wpa_write_files): Update.
(free_ltrans_partitions): Update.
(add_references_to_partition): Update.
(add_cgraph_node_to_partition_1): Update.
(add_cgraph_node_to_partition): Update.
(add_varpool_node_to_partition): Update.
(undo_partition): Update.
(lto_balanced_map): Update.
(set_referenced_from_other_partition_p, set_reachable_from_other_partition_p,
set_referenced_from_this_partition_p): Update.
(lto_promote_cross_file_statics): Update.
From-SVN: r191107
2012-09-09 14:31:32 +02:00
|
|
|
lto_stats.num_output_symtab_nodes);
|
2009-10-03 23:10:11 +02:00
|
|
|
|
lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
2013-06-17 Richard Biener <rguenther@suse.de>
* lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
(lto_input_scc): Declare.
(lto_input_tree_1): Likewise.
(struct lto_stats_d): Add num_tree_bodies_output and
num_pickle_refs_output.
* lto-streamer-in.c (lto_read_body): Use streamer_tree_cache_get_tree.
(lto_read_tree_1): Split out from ...
(lto_read_tree): ... this.
(lto_input_scc): New function.
(lto_input_tree_1): Split out from ...
(lto_input_tree): ... this. Handle LTO_tree_scc.
(lto_data_in_create): Create the streamer cache without hashes.
* lto-streamer-out.c (create_output_block): Create the streamer
cache with hashes when not doing WPA.
(lto_write_tree_1): Split out from ...
(lto_write_tree): ... this.
(get_symbol_initial_value): New function.
(lto_output_tree_1): Split out from ...
(lto_output_tree): ... this. Write trees as series of SCCs
using a DFS walk via DFS_write_tree.
(struct sccs, struct scc_entry): New types.
(next_dfs_num, sccstack, sccstate, sccstate_obstack): New globals.
(DFS_write_tree_body): New function.
(DFS_write_tree): Likewise.
(hash_tree): Likewise.
(scc_entry_compare): Likewise.
(hash_scc): Likewise.
(tree_is_indexable): DEBUG_EXPR_DECLs are local entities.
* tree-streamer-in.c (lto_input_ts_list_tree_pointers): Stream
TREE_CHAIN as regular reference.
(streamer_read_integer_cst): Remove.
(streamer_get_pickled_tree): Adjust.
* tree-streamer-out.c (streamer_write_chain): Disable streaming
of DECL_EXTERNALs in BLOCK_VARS for now.
(write_ts_list_tree_pointers): Stream TREE_CHAIN as regular
reference.
* tree-streamer.c (streamer_tree_cache_add_to_node_array):
Add hash value argument and record that if hashes are recorded
in the cache.
(streamer_tree_cache_insert_1): Adjust.
(streamer_tree_cache_insert): Likewise.
(streamer_tree_cache_insert_at): Rename to ...
(streamer_tree_cache_replace_tree): ... this and adjust.
(streamer_tree_cache_append): Adjust.
(record_common_node): Likewise.
(streamer_tree_cache_create): Add argument whether to
record hash values together with trees.
(streamer_tree_cache_delete): Adjust.
* tree-streamer.h (struct streamer_tree_cache_d): Add
vector of hashes.
(streamer_read_integer_cst): Remove.
(streamer_tree_cache_insert): Adjust.
(streamer_tree_cache_append): Likewise.
(streamer_tree_cache_insert_at): Rename to ...
(streamer_tree_cache_replace_tree): ... this and adjust.
(streamer_tree_cache_create): Add argument whether to record hashes.
(streamer_tree_cache_get): Rename to ...
(streamer_tree_cache_get_tree): ... this.
(streamer_tree_cache_get_hash): New function.
* tree.c (cache_integer_cst): New function.
* tree.h (cache_integer_cst): Declare.
(ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move here from cp/cp-tree.h.
* lto-symtab.c (lto_varpool_replace_node): Only release
DECL_INITIAL of non-prevailing decls.
* varpool.c (varpool_remove_initializer): Do not release
DECL_INITIAL when we are still in CGRAPH_LTO_STREAMING.
cp/
* cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
lto/
* Make-lang.in (lto.o): Add $(DATA_STREAMER_H) dependency.
* lto.c: Include data-streamer.h.
(lto_read_in_decl_state): Use streamer_tree_cache_get_tree.
(gimple_type_leader_entry_s, gimple_type_leader,
gimple_lookup_type_leader): Remove.
(gtc_visit): Simplify.
(gimple_types_compatible_p): Likewise.
(gimple_register_type_1): Likewise. Merge into ...
(gimple_register_type): ... this. Keep it as legacy for
statistics purposes for now.
(fixup_integer_cst): Remove.
(LTO_FIXUP_TREE, lto_fixup_types, lto_ft_*): Simplify and
rename to ...
(MAYBE_REMEMBER_WITH_VARS, maybe_remember_with_vars,
maybe_remember_with_vars_*): ... these.
(uniquify_nodes): Remove.
(lto_fixup_prevailing_type): New function.
(struct tree_scc, struct tree_scc_hasher): New type and hasher.
(tree_scc_hash, tree_scc_hash_obstack): New globals.
(num_merged_types, num_prevailing_types, num_not_merged_types,
num_not_merged_types_in_same_scc, total_scc_size, num_sccs_read,
total_scc_size_merged, num_sccs_merged, num_scc_compares,
num_scc_compare_collisions): New global counters.
(compare_tree_sccs_1): New function.
(compare_tree_sccs): Likewise.
(unify_scc): Likewise.
(lto_read_decls): Stream in tree SCCs and unify them on the
way in. Finalize prevailing SCC tree members.
(read_cgraph_and_symbols): Do not initialize or free gimple_type_leader.
Allocate and free tree_scc_hash_obstack and tree_scc_hash, do not bother
to ggc-collect during merging.
(print_lto_report_1): Adjust for new merging code.
From-SVN: r200151
2013-06-17 17:08:24 +02:00
|
|
|
fprintf (stderr, "[%s] # of output tree pickle references: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_pickle_refs_output);
|
|
|
|
fprintf (stderr, "[%s] # of output tree bodies: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_tree_bodies_output);
|
|
|
|
|
2009-10-03 23:10:11 +02:00
|
|
|
fprintf (stderr, "[%s] # callgraph partitions: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED "\n", s,
|
|
|
|
lto_stats.num_cgraph_partitions);
|
|
|
|
|
|
|
|
fprintf (stderr, "[%s] Compression: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED " input bytes, "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED " uncompressed bytes", s,
|
|
|
|
lto_stats.num_input_il_bytes,
|
|
|
|
lto_stats.num_uncompressed_il_bytes);
|
|
|
|
if (lto_stats.num_input_il_bytes > 0)
|
|
|
|
{
|
|
|
|
const float dividend = (float) lto_stats.num_uncompressed_il_bytes;
|
|
|
|
const float divisor = (float) lto_stats.num_input_il_bytes;
|
|
|
|
fprintf (stderr, " (ratio: %f)", dividend / divisor);
|
|
|
|
}
|
|
|
|
fprintf (stderr, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < LTO_N_SECTION_TYPES; i++)
|
|
|
|
fprintf (stderr, "[%s] Size of mmap'd section %s: "
|
|
|
|
HOST_WIDE_INT_PRINT_UNSIGNED " bytes\n", s,
|
|
|
|
lto_section_name[i], lto_stats.section_size[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-04-28 21:01:00 +02:00
|
|
|
#ifdef LTO_STREAMER_DEBUG
|
|
|
|
struct tree_hash_entry
|
|
|
|
{
|
|
|
|
tree key;
|
|
|
|
intptr_t value;
|
|
|
|
};
|
|
|
|
|
2013-04-26 02:28:35 +02:00
|
|
|
struct tree_entry_hasher : typed_noop_remove <tree_hash_entry>
|
|
|
|
{
|
|
|
|
typedef tree_hash_entry value_type;
|
|
|
|
typedef tree_hash_entry compare_type;
|
|
|
|
static inline hashval_t hash (const value_type *);
|
|
|
|
static inline bool equal (const value_type *, const compare_type *);
|
|
|
|
};
|
|
|
|
|
|
|
|
inline hashval_t
|
|
|
|
tree_entry_hasher::hash (const value_type *e)
|
2010-04-28 21:01:00 +02:00
|
|
|
{
|
|
|
|
return htab_hash_pointer (e->key);
|
|
|
|
}
|
|
|
|
|
2013-04-26 02:28:35 +02:00
|
|
|
inline bool
|
|
|
|
tree_entry_hasher::equal (const value_type *e1, const compare_type *e2)
|
2010-04-28 21:01:00 +02:00
|
|
|
{
|
|
|
|
return (e1->key == e2->key);
|
|
|
|
}
|
2013-04-26 02:28:35 +02:00
|
|
|
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
static hash_table<tree_hash_entry> *tree_htab;
|
2010-04-28 21:01:00 +02:00
|
|
|
#endif
|
|
|
|
|
2009-10-03 23:10:11 +02:00
|
|
|
/* Initialization common to the LTO reader and writer. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_streamer_init (void)
|
|
|
|
{
|
|
|
|
/* Check that all the TS_* handled by the reader and writer routines
|
|
|
|
match exactly the structures defined in treestruct.def. When a
|
|
|
|
new TS_* astructure is added, the streamer should be updated to
|
|
|
|
handle it. */
|
2011-08-12 18:42:13 +02:00
|
|
|
streamer_check_handled_ts_structures ();
|
2010-04-28 21:01:00 +02:00
|
|
|
|
|
|
|
#ifdef LTO_STREAMER_DEBUG
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
tree_htab = new hash_table<tree_hash_entry> (31);
|
2010-04-28 21:01:00 +02:00
|
|
|
#endif
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Gate function for all LTO streaming passes. */
|
|
|
|
|
|
|
|
bool
|
|
|
|
gate_lto_out (void)
|
|
|
|
{
|
|
|
|
return ((flag_generate_lto || in_lto_p)
|
|
|
|
/* Don't bother doing anything if the program has errors. */
|
diagnostic-core.h: New.
* diagnostic-core.h: New. Contents moved from diagnostic.h and
toplev.h.
* diagnostic.c: Don't include toplev.h.
(progname): Define. Moved from toplev.c.
(seen_error): New function.
* diagnostic.h: Include diagnostic-core.h.
(diagnostic_t, emit_diagnostic): Don't declare here.
* toplev.c (progname): Move to toplev.c.
(emit_debug_global_declarations, compile_file, finalize,
do_compile, toplev_main): Use seen_error.
* toplev.h: Include diagnostic-core.h.
(trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG,
internal_error, warning, warning_at, error, error_n, error_at,
fatal_error, pedwarn, permerror, sorry, inform, inform_n,
verbatim, fnotice, progname): Move to diagnostic-core.h.
* builtins.c: Include diagnostic-core.h instead of diagnostic.h.
(expand_builtin_expect): Use seen_error.
* c-decl.c: Include diagnostic-core.h instead of diagnostic.h.
(c_make_fname_decl, c_write_global_declarations): Use seen_error.
* c-format.c: Include diagnostic-core.h instead of diagnostic.h.
* c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h.
* c-lang.c: Include diagnostic-core.h instead of diagnostic.h.
* c-lex.c (c_lex_with_flags, interpret_float): Don't increment
errorcount for errors.
* c-opts.c (c_common_finish): Use seen_error.
* cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
* cgraphunit.c (verify_cgraph_node, verify_cgraph,
cgraph_output_pending_asms, cgraph_optimize): Use seen_error.
* coverage.c: Include diagnostic-core.h instead of diagnostic.h.
(get_coverage_counts): Use seen_error.
* dwarf2out.c (dwarf2out_finish): Use seen_error.
* gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup,
gimplify_body): Use seen_error.
* ipa-inline.c (cgraph_early_inlining): Use seen_error.
* ipa-pure-const.c (gate_pure_const): Use seen_error.
* ipa-reference.c (gate_reference): Use seen_error.
* jump.c: Include diagnostic-core.h instead of diagnostic.h.
* lambda-code.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
* lto-compress.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-section-in.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-streamer-out.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-streamer.c: Include diagnostic-core.h instead of
diagnostic.h.
(gate_lto_out): Use seen_error.
* matrix-reorg.c: Include diagnostic-core.h instead of
diagnostic.h.
* omega.c: Include diagnostic-core.h instead of diagnostic.h.
* omp-low.c: Include diagnostic-core.h instead of diagnostic.h.
(gate_expand_omp, lower_omp_1): Use seen_error.
* passes.c: Include diagnostic-core.h instead of diagnostic.h.
(rest_of_decl_compilation, rest_of_type_compilation,
gate_rest_of_compilation, ipa_write_summaries): Use seen_error.
* tree-cfg.c (label_to_block_fn): Use seen_error.
* tree-inline.c (optimize_inline_calls): Use seen_error.
* tree-mudflap.c (mudflap_finish_file): Use
seen_error.
* tree-optimize.c (gate_all_optimizations,
gate_all_early_local_passes, gate_all_early_optimizations): Use
seen_error.
* tree-ssa-structalias.c (gate_ipa_pta): Use seen_error.
* varpool.c: Include diagnostic-core.h instead of diagnostic.h.
(varpool_remove_unreferenced_decls,
varpool_assemble_pending_decls): Use seen_error.
* Makefile.in (DIAGNOSTIC_CORE_H): Define.
(TOPLEV_H, DIAGNOSTIC_H): Update.
(c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o,
lto-streamer-out.o, lto-section-in.o, lto-streamer.o,
c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o,
builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o,
coverage.o, lambda-code.o): Update dependencies.
cp:
* call.c: Include diagnostic-core.h instead of diagnostic.h.
* cp-lang.c: Don't include diagnostic.h
* name-lookup.c: Include diagnostic-core.h instead of
diagnostic.h.
(cp_emit_debug_info_for_using): Use seen_error.
* optimize.c: Include diagnostic-core.h instead of diagnostic.h.
* parser.c: Include diagnostic-core.h instead of diagnostic.h.
* pt.c (iterative_hash_template_arg): Use seen_error.
* repo.c: Include diagnostic-core.h instead of diagnostic.h.
* typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
* Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
dependencies.
lto:
* lto.c: Include diagnostic-core.h instead of diagnostic.h.
(read_cgraph_and_symbols, lto_main): Use seen_error.
* Make-lang.in (lto/lto.o): Update dependencies.
objc:
* objc-act.c: Include diagnostic-core.h instead of diagnostic.h.
* Make-lang.in (objc/objc-act.o): Update dependencies.
From-SVN: r159947
2010-05-27 22:16:07 +02:00
|
|
|
&& !seen_error ());
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LTO_STREAMER_DEBUG
|
|
|
|
/* Add a mapping between T and ORIG_T, which is the numeric value of
|
|
|
|
the original address of T as it was seen by the LTO writer. This
|
|
|
|
mapping is useful when debugging streaming problems. A debugging
|
|
|
|
session can be started on both reader and writer using ORIG_T
|
|
|
|
as a breakpoint value in both sessions.
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
Note that this mapping is transient and only valid while T is
|
2009-10-03 23:10:11 +02:00
|
|
|
being reconstructed. Once T is fully built, the mapping is
|
|
|
|
removed. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_orig_address_map (tree t, intptr_t orig_t)
|
|
|
|
{
|
2010-04-28 21:01:00 +02:00
|
|
|
struct tree_hash_entry ent;
|
|
|
|
struct tree_hash_entry **slot;
|
|
|
|
|
|
|
|
ent.key = t;
|
|
|
|
ent.value = orig_t;
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
slot = tree_htab->find_slot (&ent, INSERT);
|
2010-04-28 21:01:00 +02:00
|
|
|
gcc_assert (!*slot);
|
|
|
|
*slot = XNEW (struct tree_hash_entry);
|
|
|
|
**slot = ent;
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Get the original address of T as it was seen by the writer. This
|
|
|
|
is only valid while T is being reconstructed. */
|
|
|
|
|
|
|
|
intptr_t
|
|
|
|
lto_orig_address_get (tree t)
|
|
|
|
{
|
2010-04-28 21:01:00 +02:00
|
|
|
struct tree_hash_entry ent;
|
|
|
|
struct tree_hash_entry **slot;
|
|
|
|
|
|
|
|
ent.key = t;
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
slot = tree_htab->find_slot (&ent, NO_INSERT);
|
2010-04-28 21:01:00 +02:00
|
|
|
return (slot ? (*slot)->value : 0);
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear the mapping of T to its original address. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_orig_address_remove (tree t)
|
|
|
|
{
|
2010-04-28 21:01:00 +02:00
|
|
|
struct tree_hash_entry ent;
|
|
|
|
struct tree_hash_entry **slot;
|
|
|
|
|
|
|
|
ent.key = t;
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
slot = tree_htab->find_slot (&ent, NO_INSERT);
|
2010-04-28 21:01:00 +02:00
|
|
|
gcc_assert (slot);
|
|
|
|
free (*slot);
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
tree_htab->clear_slot (slot);
|
2009-10-03 23:10:11 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Check that the version MAJOR.MINOR is the correct version number. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_check_version (int major, int minor)
|
|
|
|
{
|
|
|
|
if (major != LTO_major_version || minor != LTO_minor_version)
|
|
|
|
fatal_error ("bytecode stream generated with LTO version %d.%d instead "
|
|
|
|
"of the expected %d.%d",
|
|
|
|
major, minor,
|
|
|
|
LTO_major_version, LTO_minor_version);
|
|
|
|
}
|
2011-06-06 18:49:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Initialize all the streamer hooks used for streaming GIMPLE. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lto_streamer_hooks_init (void)
|
|
|
|
{
|
|
|
|
streamer_hooks_init ();
|
2011-08-11 14:02:34 +02:00
|
|
|
streamer_hooks.write_tree = lto_output_tree;
|
|
|
|
streamer_hooks.read_tree = lto_input_tree;
|
2012-10-10 16:27:59 +02:00
|
|
|
streamer_hooks.input_location = lto_input_location;
|
|
|
|
streamer_hooks.output_location = lto_output_location;
|
2011-06-06 18:49:11 +02:00
|
|
|
}
|