https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119614
--- Comment #34 from Jan Hubicka <hubicka at gcc dot gnu.org> --- I there is only problem that ipa_return_value_sum value sum does not survive from compile time to WPA then we only need to add streaming code for it. This should be straightforward and there is no need to add it into cgraph_nodes or clone_summaries. We have other summaries (ipa-modref and ipa-reference) which behaves same way. I think it can go to existing ipa-cp summaries (jmpfuncs and ipcp_trans sections). Just after streaming the existing info we want to stream all these summaries. We already have in ipcp_write_transformation_summaries. One can follow same logic as ipa-modref already does: for (int i = 0; i < lto_symtab_encoder_size (encoder); i++) { symtab_node *snode = lto_symtab_encoder_deref (encoder, i); cgraph_node *cnode = dyn_cast <cgraph_node *> (snode); if (!cnode) continue; ipcp_transformation *ts = ipcp_get_transformation_summary (cnode); if (useful_ipcp_transformation_info_p (ts) && lto_symtab_encoder_encode_body_p (encoder, cnode)) count++; } streamer_write_uhwi (ob, count); for (int i = 0; i < lto_symtab_encoder_size (encoder); i++) { symtab_node *snode = lto_symtab_encoder_deref (encoder, i); cgraph_node *cnode = dyn_cast <cgraph_node *> (snode); if (!cnode) continue; ipcp_transformation *ts = ipcp_get_transformation_summary (cnode); if (useful_ipcp_transformation_info_p (ts) && lto_symtab_encoder_encode_body_p (encoder, cnode)) write_ipcp_transformation_info (ob, cnode, ts); } streamer_write_char_stream (ob->main_stream, 0); So then one needs to stream return value summaries and since we want to stream them for functions that are referenced in some way in the ltrans we want to do: count = 0; for (i = 0; i < lto_symtab_encoder_size (encoder); i++) { symtab_node *snode = lto_symtab_encoder_deref (encoder, i); cgraph_node *cnode = dyn_cast <cgraph_node *> (snode); if (cnode && cnode->definition && ... want to stream return value info ...) count++; } ... this counts all functions we want to encode summary for. All of them are in encoder and we only want to pick those with interesting return value info on them. Then one can repeat the loop for actual streaming streamer_write_uhwi (ob, count); for (int i = 0; i < lto_symtab_encoder_size (encoder); i++) { symtab_node *snode = lto_symtab_encoder_deref (encoder, i); cgraph_node *cnode = dyn_cast <cgraph_node *> (snode); if (cnode && cnode->define ition && ... want to stream return value info ) ... stream it here } streamer_write_char_stream (ob->main_stream, 0); If this is a separate function, it can be used from both ipcp_write_transformation_summaries and ipa_prop_write_jump_functions We need to double-check that this works for aliases. If function alias is referenced in an ltrans, its alias target should be streamed too and lookup should work. I a plan for tonight and I want to first finish review of the vectorizer profile update, but for sure I can implement this by tomorrow's lunchtime.