aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-08-10 00:53:00 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-09 22:53:00 +0000
commit634ab819546e358bae26a7f798652f1271ae099d (patch)
tree8a4fa2cb049df6b6085971ee7b7c3615601cc693 /gcc/lto-cgraph.c
parent537a6f7b4752b04a5ce4cb1fb96f1f1e9c407402 (diff)
downloadgcc-634ab819546e358bae26a7f798652f1271ae099d.zip
gcc-634ab819546e358bae26a7f798652f1271ae099d.tar.gz
gcc-634ab819546e358bae26a7f798652f1271ae099d.tar.bz2
cgraph.c (cgraph_resolve_speculation): Cut frequency to CGRAPH_FREQ_MAX.
* cgraph.c (cgraph_resolve_speculation): Cut frequency to CGRAPH_FREQ_MAX. (dump_cgraph_node): Dump profile-id. * cgraph.h (cgraph_indirect_call_info): Add common_target_id and common_target_probability. * lto-cgraph.c (lto_output_edge): Stream common targets. (lto_output_node): Stream profile ids. (input_node): Stream profile ids. (input_edge): Stream common targets. * lto-streamer-in.c (fixup_call_stmt_edges_1): Fix formatting. * ipa.c: Include value-prof.h (ipa_profile_generate_summary): Turn indirect call statement histograms into common targets. (ipa_profile): Turn common targets into speculative edges. * gcc.dg/tree-prof/crossmodule-indircall-1.c: New testcase. * gcc.dg/tree-prof/crossmodule-indircall-1a.c: New testcase. From-SVN: r201639
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index e0d0991..fcba1b9 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -299,6 +299,14 @@ lto_output_edge (struct lto_simple_output_block *ob, struct cgraph_edge *edge,
| ECF_NOVOPS)));
}
streamer_write_bitpack (&bp);
+ if (edge->indirect_unknown_callee)
+ {
+ streamer_write_hwi_stream (ob->main_stream,
+ edge->indirect_info->common_target_id);
+ if (edge->indirect_info->common_target_id)
+ streamer_write_hwi_stream
+ (ob->main_stream, edge->indirect_info->common_target_probability);
+ }
}
/* Return if LIST contain references from other partitions. */
@@ -519,6 +527,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset);
streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value);
}
+ streamer_write_hwi_stream (ob->main_stream, node->profile_id);
}
/* Output the varpool NODE to OB.
@@ -1057,6 +1066,7 @@ input_node (struct lto_file_decl_data *file_data,
}
if (node->symbol.alias && !node->symbol.analyzed && node->symbol.weakref)
node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
+ node->profile_id = streamer_read_hwi (ib);
return node;
}
@@ -1205,6 +1215,9 @@ input_edge (struct lto_input_block *ib, vec<symtab_node> nodes,
if (bp_unpack_value (&bp, 1))
ecf_flags |= ECF_RETURNS_TWICE;
edge->indirect_info->ecf_flags = ecf_flags;
+ edge->indirect_info->common_target_id = streamer_read_hwi (ib);
+ if (edge->indirect_info->common_target_id)
+ edge->indirect_info->common_target_probability = streamer_read_hwi (ib);
}
}