diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-14 18:54:17 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-14 18:54:17 +0000 |
commit | 30baba90876315f244564139b4dbd608583f01f1 (patch) | |
tree | 1c5576f53e0b1246f2c6689424de8733223cce84 /gcc/lto-streamer-in.c | |
parent | b784aaebdb576e4315aae6c520c752bd1ea4286e (diff) | |
download | gcc-30baba90876315f244564139b4dbd608583f01f1.tar.gz |
2010-06-14 Richard Guenther <rguenther@suse.de>
* lto-streamer.c (cached_bp): Remove.
(bitpack_delete): Likewise.
(bitpack_create): Likewise.
(bp_get_next_word): Likewise.
(bp_pack_value, bp_unpack_value): Move ...
* lto-streamer.h (bp_pack_value, bp_unpack_value): ... here.
Re-implement.
(struct bitpack_d): Likewise.
(bitpack_create, lto_output_bitpack, lto_input_bitpack):
New inline functions.
* lto-streamer-out.c (lto_output_bitpack): Remove.
(pack_ts_base_value_fields): Adjust. Avoid conditional
bitpacking.
(pack_value_fields): Adjust.
(lto_write_tree): Likewise.
(output_gimple_stmt): Likewise.
(output_function): Likewise.
* lto-streamer-in.c (input_gimple_stmt): Adjust.
(input_function): Likewise.
(unpack_ts_base_value_fields): Adjust. Avoid conditional
bitpacking.
(lto_input_bitpack): Remove.
(lto_materialize_tree): Adjust.
* Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency.
* lto-cgraph.c (lto_output_edge): Adjust.
(lto_output_node): Likewise.
(lto_output_varpool_node): Likewise.
(lto_output_ref): Likewise.
(input_node): Likewise.
(input_varpool_node): Likewise.
(input_ref): Likewise.
(input_edge): Likewise.
(output_node_opt_summary): Likewise.
(input_node_opt_summary): Likewise.
* ipa-pure-const.c (pure_const_write_summary): Likewise.
(pure_const_read_summary): Likewise.
* ipa-prop.c (ipa_write_indirect_edge_info): Likewise.
(ipa_read_indirect_edge_info): Likewise.
(ipa_write_node_info): Likewise.
(ipa_read_node_info): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-in.c')
-rw-r--r-- | gcc/lto-streamer-in.c | 87 |
1 files changed, 32 insertions, 55 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index d56cf5d90b1..e875460fa0b 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1001,20 +1001,19 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in, enum gimple_code code; unsigned HOST_WIDE_INT num_ops; size_t i; - struct bitpack_d *bp; + struct bitpack_d bp; code = lto_tag_to_gimple_code (tag); /* Read the tuple header. */ bp = lto_input_bitpack (ib); - num_ops = bp_unpack_value (bp, sizeof (unsigned) * 8); + num_ops = bp_unpack_value (&bp, sizeof (unsigned) * 8); stmt = gimple_alloc (code, num_ops); - stmt->gsbase.no_warning = bp_unpack_value (bp, 1); + stmt->gsbase.no_warning = bp_unpack_value (&bp, 1); if (is_gimple_assign (stmt)) - stmt->gsbase.nontemporal_move = bp_unpack_value (bp, 1); - stmt->gsbase.has_volatile_ops = bp_unpack_value (bp, 1); - stmt->gsbase.subcode = bp_unpack_value (bp, 16); - bitpack_delete (bp); + stmt->gsbase.nontemporal_move = bp_unpack_value (&bp, 1); + stmt->gsbase.has_volatile_ops = bp_unpack_value (&bp, 1); + stmt->gsbase.subcode = bp_unpack_value (&bp, 16); /* Read location information. */ gimple_set_location (stmt, lto_input_location (ib, data_in)); @@ -1291,7 +1290,7 @@ input_function (tree fn_decl, struct data_in *data_in, enum LTO_tags tag; gimple *stmts; basic_block bb; - struct bitpack_d *bp; + struct bitpack_d bp; struct cgraph_node *node; tree args, narg, oarg; @@ -1304,22 +1303,21 @@ input_function (tree fn_decl, struct data_in *data_in, /* Read all the attributes for FN. */ bp = lto_input_bitpack (ib); - fn->is_thunk = bp_unpack_value (bp, 1); - fn->has_local_explicit_reg_vars = bp_unpack_value (bp, 1); - fn->after_tree_profile = bp_unpack_value (bp, 1); - fn->returns_pcc_struct = bp_unpack_value (bp, 1); - fn->returns_struct = bp_unpack_value (bp, 1); - fn->can_throw_non_call_exceptions = bp_unpack_value (bp, 1); - fn->always_inline_functions_inlined = bp_unpack_value (bp, 1); - fn->after_inlining = bp_unpack_value (bp, 1); - fn->dont_save_pending_sizes_p = bp_unpack_value (bp, 1); - fn->stdarg = bp_unpack_value (bp, 1); - fn->has_nonlocal_label = bp_unpack_value (bp, 1); - fn->calls_alloca = bp_unpack_value (bp, 1); - fn->calls_setjmp = bp_unpack_value (bp, 1); - fn->va_list_fpr_size = bp_unpack_value (bp, 8); - fn->va_list_gpr_size = bp_unpack_value (bp, 8); - bitpack_delete (bp); + fn->is_thunk = bp_unpack_value (&bp, 1); + fn->has_local_explicit_reg_vars = bp_unpack_value (&bp, 1); + fn->after_tree_profile = bp_unpack_value (&bp, 1); + fn->returns_pcc_struct = bp_unpack_value (&bp, 1); + fn->returns_struct = bp_unpack_value (&bp, 1); + fn->can_throw_non_call_exceptions = bp_unpack_value (&bp, 1); + fn->always_inline_functions_inlined = bp_unpack_value (&bp, 1); + fn->after_inlining = bp_unpack_value (&bp, 1); + fn->dont_save_pending_sizes_p = bp_unpack_value (&bp, 1); + fn->stdarg = bp_unpack_value (&bp, 1); + fn->has_nonlocal_label = bp_unpack_value (&bp, 1); + fn->calls_alloca = bp_unpack_value (&bp, 1); + fn->calls_setjmp = bp_unpack_value (&bp, 1); + fn->va_list_fpr_size = bp_unpack_value (&bp, 8); + fn->va_list_gpr_size = bp_unpack_value (&bp, 8); /* Input the current IL state of the function. */ fn->curr_properties = lto_input_uleb128 (ib); @@ -1581,12 +1579,16 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr) so we skip it here. */ TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1); } + else + bp_unpack_value (bp, 4); TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1); TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1); if (DECL_P (expr)) DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1); else if (TYPE_P (expr)) TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1); + else + bp_unpack_value (bp, 1); TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1); TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1); TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1); @@ -1597,8 +1599,10 @@ unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr) TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1); if (TYPE_P (expr)) TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1); - if (TREE_CODE (expr) == SSA_NAME) + else if (TREE_CODE (expr) == SSA_NAME) SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1); + else + bp_unpack_value (bp, 1); } @@ -1858,32 +1862,6 @@ unpack_value_fields (struct bitpack_d *bp, tree expr) } -/* Read a bitpack from input block IB. */ - -struct bitpack_d * -lto_input_bitpack (struct lto_input_block *ib) -{ - unsigned i, num_words; - struct bitpack_d *bp; - - bp = bitpack_create (); - - /* If we are about to read more than a handful of words, something - is wrong. This check is overly strict, but it acts as an early - warning. No streamed object has hundreds of bits in its fields. */ - num_words = lto_input_uleb128 (ib); - gcc_assert (num_words < 20); - - for (i = 0; i < num_words; i++) - { - bitpack_word_t w = lto_input_uleb128 (ib); - VEC_safe_push (bitpack_word_t, heap, bp->values, w); - } - - return bp; -} - - /* Materialize a new tree from input block IB using descriptors in DATA_IN. The code for the new tree should match TAG. Store in *IX_P the index into the reader cache where the new tree is stored. */ @@ -1892,7 +1870,7 @@ static tree lto_materialize_tree (struct lto_input_block *ib, struct data_in *data_in, enum LTO_tags tag, int *ix_p) { - struct bitpack_d *bp; + struct bitpack_d bp; enum tree_code code; tree result; #ifdef LTO_STREAMER_DEBUG @@ -1957,12 +1935,11 @@ lto_materialize_tree (struct lto_input_block *ib, struct data_in *data_in, /* The first word in BP contains the code of the tree that we are about to read. */ - code = (enum tree_code) bp_unpack_value (bp, 16); + code = (enum tree_code) bp_unpack_value (&bp, 16); lto_tag_check (lto_tree_code_to_tag (code), tag); /* Unpack all the value fields from BP. */ - unpack_value_fields (bp, result); - bitpack_delete (bp); + unpack_value_fields (&bp, result); /* Enter RESULT in the reader cache. This will make RESULT available so that circular references in the rest of the tree |