From patchwork Sat Dec 4 22:02:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Allow merging of units with profile feedback run different amount of times Date: Sat, 04 Dec 2010 12:02:48 -0000 From: Jan Hubicka X-Patchwork-Id: 74282 Message-Id: <20101204220248.GD11171@kam.mff.cuni.cz> To: Jan Hubicka Cc: "H.J. Lu" , gcc-patches@gcc.gnu.org > Hmm, missing dependency causing race during parallel build. I will commit the obvious > fix adding dependency to lto-streamer.h on gcov-io.h Hi, this is what I committed. I also noticed thinko in count_materialization_scale computation. We should be scaling based on runs not run_max. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 167458) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2010-12-03 Jan Hubicka + * Makefile.in (LTO_STREAMER_H): Add GCOV_IO_H. + * lto-cgraph.c (merge_profile_summaries): Fix thinko. + +2010-12-03 Jan Hubicka + PR tree-optimization/46760 * cgraph.c (cgraph_create_node): Initialize count_materialization_scale. * cgraph.h (struct cgraph_node): Add count_materialization_scale. Index: Makefile.in =================================================================== --- Makefile.in (revision 167457) +++ Makefile.in (working copy) @@ -975,7 +975,8 @@ IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) DBGCNT_H = dbgcnt.h dbgcnt.def EBITMAP_H = ebitmap.h sbitmap.h LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \ - $(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) + $(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) \ + $(GCOV_IO_H) TREE_VECTORIZER_H = tree-vectorizer.h $(TREE_DATA_REF_H) IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) GSTAB_H = gstab.h stab.def Index: lto-cgraph.c =================================================================== --- lto-cgraph.c (revision 167458) +++ lto-cgraph.c (working copy) @@ -1504,16 +1504,14 @@ merge_profile_summaries (struct lto_file During LTRANS we already have values of count_materialization_scale computed, so just update them. */ for (node = cgraph_nodes; node; node = node->next) - if (node->local.lto_file_data->profile_info.run_max) + if (node->local.lto_file_data->profile_info.runs) { int scale; - if (node->local.lto_file_data->profile_info.runs) - scale = - ((node->count_materialization_scale * max_runs - + node->local.lto_file_data->profile_info.run_max / 2) - / node->local.lto_file_data->profile_info.run_max); - else - scale = node->count_materialization_scale; + + scale = + ((node->count_materialization_scale * max_runs + + node->local.lto_file_data->profile_info.runs / 2) + / node->local.lto_file_data->profile_info.runs); node->count_materialization_scale = scale; if (scale < 0) fatal_error ("Profile information in %s corrupted",