+/* Set the frequencies for the cgraph_edges for each of the calls
+ starting at FIRST for their new position within BB. */
+
+static void
+update_call_edge_frequencies (gimple_seq_node first, basic_block bb)
+{
+ struct cgraph_node *cfun_node = NULL;
+ int bb_freq = 0;
+ gimple_seq_node n;
+
+ for (n = first; n ; n = n->next)
+ if (is_gimple_call (n->stmt))
+ {
+ struct cgraph_edge *e;
+
+ /* These function calls are expensive enough that we want
+ to avoid calling them if we never see any calls. */
+ if (cfun_node == NULL)
+ {
+ cfun_node = cgraph_node (current_function_decl);
+ bb_freq = (compute_call_stmt_bb_frequency
+ (current_function_decl, bb));
+ }
+
+ e = cgraph_edge (cfun_node, n->stmt);
+ if (e != NULL)
+ e->frequency = bb_freq;
+ }
+}