Commit 6ab601ef by Richard Biener Committed by Richard Biener

lto-streamer.h (lto_bitmap_alloc): Remove.

2019-06-26  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (lto_bitmap_alloc): Remove.
	(lto_bitmap_free): Likewise.
	* lto-streamer.c (lto_bitmap_alloc): Remove.
	(lto_bitmap_free): Likewise.
	(lto_obstack): Likewise.
	(lto_obstack_initialized): Likewise.
	* lto-streamer-out.c (lto_output): Use own obstack for local
	bitmap, free it consistently.

From-SVN: r272687
parent 7cfb7260
2019-06-26 Richard Biener <rguenther@suse.de>
* lto-streamer.h (lto_bitmap_alloc): Remove.
(lto_bitmap_free): Likewise.
* lto-streamer.c (lto_bitmap_alloc): Remove.
(lto_bitmap_free): Likewise.
(lto_obstack): Likewise.
(lto_obstack_initialized): Likewise.
* lto-streamer-out.c (lto_output): Use own obstack for local
bitmap, free it consistently.
2019-06-26 Jakub Jelinek <jakub@redhat.com> 2019-06-26 Jakub Jelinek <jakub@redhat.com>
PR target/90991 PR target/90991
......
...@@ -2397,13 +2397,17 @@ lto_output (void) ...@@ -2397,13 +2397,17 @@ lto_output (void)
{ {
struct lto_out_decl_state *decl_state; struct lto_out_decl_state *decl_state;
bitmap output = NULL; bitmap output = NULL;
bitmap_obstack output_obstack;
int i, n_nodes; int i, n_nodes;
lto_symtab_encoder_t encoder = lto_get_out_decl_state ()->symtab_node_encoder; lto_symtab_encoder_t encoder = lto_get_out_decl_state ()->symtab_node_encoder;
prune_offload_funcs (); prune_offload_funcs ();
if (flag_checking) if (flag_checking)
output = lto_bitmap_alloc (); {
bitmap_obstack_initialize (&output_obstack);
output = BITMAP_ALLOC (&output_obstack);
}
/* Initialize the streamer. */ /* Initialize the streamer. */
lto_streamer_init (); lto_streamer_init ();
...@@ -2419,10 +2423,7 @@ lto_output (void) ...@@ -2419,10 +2423,7 @@ lto_output (void)
&& !node->alias) && !node->alias)
{ {
if (flag_checking) if (flag_checking)
{ gcc_assert (bitmap_set_bit (output, DECL_UID (node->decl)));
gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
bitmap_set_bit (output, DECL_UID (node->decl));
}
decl_state = lto_new_out_decl_state (); decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state); lto_push_out_decl_state (decl_state);
if (gimple_has_body_p (node->decl) if (gimple_has_body_p (node->decl)
...@@ -2452,10 +2453,7 @@ lto_output (void) ...@@ -2452,10 +2453,7 @@ lto_output (void)
{ {
timevar_push (TV_IPA_LTO_CTORS_OUT); timevar_push (TV_IPA_LTO_CTORS_OUT);
if (flag_checking) if (flag_checking)
{ gcc_assert (bitmap_set_bit (output, DECL_UID (node->decl)));
gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
bitmap_set_bit (output, DECL_UID (node->decl));
}
decl_state = lto_new_out_decl_state (); decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state); lto_push_out_decl_state (decl_state);
if (DECL_INITIAL (node->decl) != error_mark_node if (DECL_INITIAL (node->decl) != error_mark_node
...@@ -2480,9 +2478,11 @@ lto_output (void) ...@@ -2480,9 +2478,11 @@ lto_output (void)
output_offload_tables (); output_offload_tables ();
#if CHECKING_P if (flag_checking)
lto_bitmap_free (output); {
#endif BITMAP_FREE (output);
bitmap_obstack_release (&output_obstack);
}
} }
/* Write each node in encoded by ENCODER to OB, as well as those reachable /* Write each node in encoded by ENCODER to OB, as well as those reachable
......
...@@ -35,11 +35,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -35,11 +35,6 @@ along with GCC; see the file COPYING3. If not see
/* Statistics gathered during LTO, WPA and LTRANS. */ /* Statistics gathered during LTO, WPA and LTRANS. */
struct lto_stats_d lto_stats; struct lto_stats_d lto_stats;
/* LTO uses bitmaps with different life-times. So use a separate
obstack for all LTO bitmaps. */
static bitmap_obstack lto_obstack;
static bool lto_obstack_initialized;
const char *section_name_prefix = LTO_SECTION_NAME_PREFIX; const char *section_name_prefix = LTO_SECTION_NAME_PREFIX;
/* Set when streaming LTO for offloading compiler. */ /* Set when streaming LTO for offloading compiler. */
bool lto_stream_offload_p; bool lto_stream_offload_p;
...@@ -113,28 +108,6 @@ lto_tag_name (enum LTO_tags tag) ...@@ -113,28 +108,6 @@ lto_tag_name (enum LTO_tags tag)
} }
/* Allocate a bitmap from heap. Initializes the LTO obstack if necessary. */
bitmap
lto_bitmap_alloc (void)
{
if (!lto_obstack_initialized)
{
bitmap_obstack_initialize (&lto_obstack);
lto_obstack_initialized = true;
}
return BITMAP_ALLOC (&lto_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 /* Get a section name for a particular type or name. The NAME field
is only used if SECTION_TYPE is LTO_section_function_body. For all is only used if SECTION_TYPE is LTO_section_function_body. For all
others it is ignored. The callee of this function is responsible others it is ignored. The callee of this function is responsible
......
...@@ -822,8 +822,6 @@ extern void lto_append_block (struct lto_output_stream *); ...@@ -822,8 +822,6 @@ extern void lto_append_block (struct lto_output_stream *);
extern bool lto_stream_offload_p; extern bool lto_stream_offload_p;
extern const char *lto_tag_name (enum LTO_tags); extern const char *lto_tag_name (enum LTO_tags);
extern bitmap lto_bitmap_alloc (void);
extern void lto_bitmap_free (bitmap);
extern char *lto_get_section_name (int, const char *, struct lto_file_decl_data *); extern char *lto_get_section_name (int, const char *, struct lto_file_decl_data *);
extern void print_lto_report (const char *); extern void print_lto_report (const char *);
extern void lto_streamer_init (void); extern void lto_streamer_init (void);
......
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