streamer_write_uhwi_stream (ob->main_stream, 0);
lto_destroy_simple_output_block (ob);
-
- /* In WHOPR mode during the WPA stage the joint offload tables need to be
- streamed to one partition only. That's why we free offload_funcs and
- offload_vars after the first call of output_offload_tables. */
- if (flag_wpa)
- {
- vec_free (offload_funcs);
- vec_free (offload_vars);
- vec_free (offload_ind_funcs);
- }
}
/* Verify the partitioning of NODE. */
statements using the statement UIDs. */
output_symtab ();
- output_offload_tables ();
+ if (lto_get_out_decl_state ()->output_offload_tables_p)
+ output_offload_tables ();
if (flag_checking)
{
/* True if decl state is compressed. */
bool compressed;
+
+ /* True if offload tables should be output. */
+ bool output_offload_tables_p;
};
typedef struct lto_out_decl_state *lto_out_decl_state_ptr;
gcc_assert (!dump_file);
streamer_dump_file = dump_begin (TDI_lto_stream_out, NULL, part);
- ipa_write_optimization_summaries (encoder);
+ ipa_write_optimization_summaries (encoder, part == 0);
free (CONST_CAST (char *, file->filename));
summaries. SET is the set of nodes to be written. */
static void
-ipa_write_summaries_1 (lto_symtab_encoder_t encoder)
+ipa_write_summaries_1 (lto_symtab_encoder_t encoder,
+ bool output_offload_tables_p)
{
pass_manager *passes = g->get_passes ();
struct lto_out_decl_state *state = lto_new_out_decl_state ();
state->symtab_node_encoder = encoder;
+ state->output_offload_tables_p = output_offload_tables_p;
lto_output_init_mode_table ();
lto_push_out_decl_state (state);
if (vnode->need_lto_streaming)
lto_set_symtab_encoder_in_partition (encoder, vnode);
- ipa_write_summaries_1 (compute_ltrans_boundary (encoder));
+ ipa_write_summaries_1 (compute_ltrans_boundary (encoder),
+ flag_generate_offload);
free (order);
if (streamer_dump_file)
NULL, write out all summaries of all nodes. */
void
-ipa_write_optimization_summaries (lto_symtab_encoder_t encoder)
+ipa_write_optimization_summaries (lto_symtab_encoder_t encoder,
+ bool output_offload_tables_p)
{
struct lto_out_decl_state *state = lto_new_out_decl_state ();
state->symtab_node_encoder = encoder;
+ state->output_offload_tables_p = output_offload_tables_p;
lto_output_init_mode_table ();
lto_push_out_decl_state (state);
extern void print_current_pass (FILE *);
extern void debug_pass (void);
extern void ipa_write_summaries (void);
-extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *);
+extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *,
+ bool);
extern void ipa_read_summaries (void);
extern void ipa_read_optimization_summaries (void);
extern void register_one_dump_file (opt_pass *);