[PATCH] LTO Streaming of parameter call notes

Jan Hubicka hubicka@ucw.cz
Wed Nov 11 15:34:00 GMT 2009


> 2009-11-11  Martin Jambor  <mjambor@suse.cz>
> 
> 	* ipa-prop.h (struct ipa_param_call_note): New field lto_stmt_uid.
> 	(lto_ipa_fixup_call_notes): Declare.
> 	* ipa-prop.c (ipa_note_param_call): Store gimple uid.
> 	(update_call_notes_after_inlining): Copy call stmt uid to the new
> 	edge.
> 	(ipa_write_param_call_note): New function.
> 	(ipa_read_param_call_note): New function
> 	(ipa_write_node_info): Write also param call notes.  Removed a bogus
> 	comment, reformatted to fit 80 columns.
> 	(ipa_read_node_info): Read also param call notes. Removed a bogus
> 	comment.  Remove ipa_edge_args_vector growth.
> 	(lto_ipa_fixup_call_notes): New function.
> 	* ipa-cp.c (pass_ipa_cp): Add stmt_fixup hook.
> 	* ipa-inline.c (cgraph_mark_inline_edge): Perform indirect
> 	inlining regardless of flag_wpa.
> 	(cgraph_decide_inlining_of_small_functions): Likewise.
> 	(cgraph_decide_inlining): Likewise.
> 	(inline_read_summary): Likewise.
OK.
> +/* Stream out a parameter call note.  */
> +
> +static void
> +ipa_write_param_call_note (struct output_block *ob,
> +			   struct ipa_param_call_note *note)
> +{
> +  struct bitpack_d *bp = bitpack_create ();
> +
> +  gcc_assert (!note->processed);
> +  bp_pack_value (bp, note->lto_stmt_uid, HOST_BITS_PER_INT);
> +  bp_pack_value (bp, note->formal_id, HOST_BITS_PER_INT);
> +  bp_pack_value (bp, note->frequency, HOST_BITS_PER_INT);
> +  bp_pack_value (bp, note->loop_nest, HOST_BITS_PER_INT);

You don't need bitpacks for streaming integers.
Use uleb/slebs instead.  It is more compact and independent on HOST_BITS_PER_INT
(eventaully we want to make LTO files host independent for sure)

We also was just discussing with Richi profile feedback and LTO.  Making profiling to happen
at linktime is going to add some extra work (especially at WPA is will be tricky to read in
profile without function bodies).  So for moment we want to stream all profile into LTO files,
so stream count too.

> +
> +  for (note = info->param_calls; note; note = note->next)
> +    note_count++;
> +  lto_output_uleb128_stream (ob->main_stream, note_count);
> +  for (note = info->param_calls; note; note = note->next)
> +    ipa_write_param_call_note (ob, note);

I don't think indirect calls really belongs to jump functions section.
Soon we will need to make it part of cgraph, but for time being I guess we can
do it this way, or if you want, just add new section "indirect calls"

thanks!
Honza



More information about the Gcc-patches mailing list