Commit 5c4f225f by Jan Hubicka Committed by Jan Hubicka

passes.c (ipa_write_summaries_1, [...]): Allocate encoders.


	* passes.c (ipa_write_summaries_1, ipa_write_optimization_summaries): Allocate
	encoders.
	* lto-section-out.c (lto_new_out_decl_state): Do not allocate it here.
	* lto-streamer.c (lto_streamer_cache_insert_1): Use alloc pool.
	(lto_streamer_cache_create): Init alloc pool.
	(lto_streamer_cache_delete): Free alloc pool.
	* lto-streamer.h: Include alloc pool.
	(lto_streamer_cache_d): Use alloc pool.
	* lto-stramer-out.c (produce_asm_for_decls): Delete fn_out_states.

From-SVN: r159230
parent de61f467
2010-05-10 Jan Hubicka <jh@suse.cz> 2010-05-10 Jan Hubicka <jh@suse.cz>
* passes.c (ipa_write_summaries_1, ipa_write_optimization_summaries): Allocate
encoders.
* lto-section-out.c (lto_new_out_decl_state): Do not allocate it here.
* lto-streamer.c (lto_streamer_cache_insert_1): Use alloc pool.
(lto_streamer_cache_create): Init alloc pool.
(lto_streamer_cache_delete): Free alloc pool.
* lto-streamer.h: Include alloc pool.
(lto_streamer_cache_d): Use alloc pool.
* lto-stramer-out.c (produce_asm_for_decls): Delete fn_out_states.
2010-05-10 Jan Hubicka <jh@suse.cz>
* Makefile.in (cgraphbuild.o): Add dependency on except.h. * Makefile.in (cgraphbuild.o): Add dependency on except.h.
* cgraphbuild.c: Include except.h * cgraphbuild.c: Include except.h
(record_type_list, record_eh_tables): New function. (record_type_list, record_eh_tables): New function.
......
...@@ -542,9 +542,6 @@ lto_new_out_decl_state (void) ...@@ -542,9 +542,6 @@ lto_new_out_decl_state (void)
lto_init_tree_ref_encoder (&state->streams[i], hash_fn, eq_fn); lto_init_tree_ref_encoder (&state->streams[i], hash_fn, eq_fn);
} }
state->cgraph_node_encoder = lto_cgraph_encoder_new ();
state->varpool_node_encoder = lto_varpool_encoder_new ();
return state; return state;
} }
......
...@@ -2505,6 +2505,7 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset) ...@@ -2505,6 +2505,7 @@ produce_asm_for_decls (cgraph_node_set set, varpool_node_set vset)
fn_out_state = fn_out_state =
VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx); VEC_index (lto_out_decl_state_ptr, lto_function_decl_states, idx);
lto_output_decl_state_refs (ob, decl_state_stream, fn_out_state); lto_output_decl_state_refs (ob, decl_state_stream, fn_out_state);
lto_delete_out_decl_state (fn_out_state);
} }
lto_write_stream (decl_state_stream); lto_write_stream (decl_state_stream);
free(decl_state_stream); free(decl_state_stream);
......
...@@ -500,7 +500,7 @@ lto_streamer_cache_insert_1 (struct lto_streamer_cache_d *cache, ...@@ -500,7 +500,7 @@ lto_streamer_cache_insert_1 (struct lto_streamer_cache_d *cache,
else else
ix = *ix_p; ix = *ix_p;
entry = XCNEW (struct tree_int_map); entry = (struct tree_int_map *)pool_alloc (cache->node_map_entries);
entry->base.from = t; entry->base.from = t;
entry->to = (unsigned) ix; entry->to = (unsigned) ix;
*slot = entry; *slot = entry;
...@@ -762,6 +762,10 @@ lto_streamer_cache_create (void) ...@@ -762,6 +762,10 @@ lto_streamer_cache_create (void)
cache->node_map = htab_create (101, tree_int_map_hash, tree_int_map_eq, NULL); cache->node_map = htab_create (101, tree_int_map_hash, tree_int_map_eq, NULL);
cache->node_map_entries = create_alloc_pool ("node map",
sizeof (struct tree_int_map),
100);
/* Load all the well-known tree nodes that are always created by /* Load all the well-known tree nodes that are always created by
the compiler on startup. This prevents writing them out the compiler on startup. This prevents writing them out
unnecessarily. */ unnecessarily. */
...@@ -785,6 +789,7 @@ lto_streamer_cache_delete (struct lto_streamer_cache_d *c) ...@@ -785,6 +789,7 @@ lto_streamer_cache_delete (struct lto_streamer_cache_d *c)
return; return;
htab_delete (c->node_map); htab_delete (c->node_map);
free_alloc_pool (c->node_map_entries);
VEC_free (tree, gc, c->nodes); VEC_free (tree, gc, c->nodes);
VEC_free (unsigned, heap, c->offsets); VEC_free (unsigned, heap, c->offsets);
free (c); free (c);
......
...@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h" #include "cgraph.h"
#include "vec.h" #include "vec.h"
#include "vecprim.h" #include "vecprim.h"
#include "alloc-pool.h"
/* Define when debugging the LTO streamer. This causes the writer /* Define when debugging the LTO streamer. This causes the writer
to output the numeric value for the memory address of the tree node to output the numeric value for the memory address of the tree node
...@@ -346,6 +347,9 @@ struct lto_streamer_cache_d ...@@ -346,6 +347,9 @@ struct lto_streamer_cache_d
/* The mapping between tree nodes and slots into the nodes array. */ /* The mapping between tree nodes and slots into the nodes array. */
htab_t node_map; htab_t node_map;
/* Node map to store entries into. */
alloc_pool node_map_entries;
/* Next available slot in the nodes and offsets arrays. */ /* Next available slot in the nodes and offsets arrays. */
unsigned next_slot; unsigned next_slot;
......
...@@ -1694,6 +1694,9 @@ static void ...@@ -1694,6 +1694,9 @@ static void
ipa_write_summaries_1 (cgraph_node_set set, varpool_node_set vset) ipa_write_summaries_1 (cgraph_node_set set, varpool_node_set vset)
{ {
struct lto_out_decl_state *state = lto_new_out_decl_state (); struct lto_out_decl_state *state = lto_new_out_decl_state ();
state->cgraph_node_encoder = lto_cgraph_encoder_new ();
state->varpool_node_encoder = lto_varpool_encoder_new ();
lto_push_out_decl_state (state); lto_push_out_decl_state (state);
gcc_assert (!flag_wpa); gcc_assert (!flag_wpa);
...@@ -1805,6 +1808,8 @@ void ...@@ -1805,6 +1808,8 @@ void
ipa_write_optimization_summaries (cgraph_node_set set, varpool_node_set vset) ipa_write_optimization_summaries (cgraph_node_set set, varpool_node_set vset)
{ {
struct lto_out_decl_state *state = lto_new_out_decl_state (); struct lto_out_decl_state *state = lto_new_out_decl_state ();
state->cgraph_node_encoder = lto_cgraph_encoder_new ();
state->varpool_node_encoder = lto_varpool_encoder_new ();
lto_push_out_decl_state (state); lto_push_out_decl_state (state);
gcc_assert (flag_wpa); gcc_assert (flag_wpa);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment