On Fri, Oct 13, 2017 at 9:27 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Fri, Oct 13, 2017 at 09:06:55PM +0200, Jan Hubicka wrote: >> For EH we should set it to profile_probability::zero () because we know it >> is unlikely >> path. I will take a look. > > With the > > --- gcc/cfghooks.c.jj 2017-10-13 18:27:12.000000000 +0200 > +++ gcc/cfghooks.c 2017-10-13 19:15:11.444650533 +0200 > @@ -162,6 +162,7 @@ verify_flow_info (void) > err = 1; > } > if (profile_status_for_fn (cfun) >= PROFILE_GUESSED > + && (e->flags & (EDGE_EH | EDGE_ABNORMAL | EDGE_FAKE)) == 0 > && !e->probability.initialized_p ()) > { > error ("Uninitialized probability of edge %i->%i", > e->src->index, > > hack x86_64-linux and i686-linux bootstrapped fine, but I see still many > graphite related regressions: > > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: error: > Uninitialized probability of edge 41->17 > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: error: > Uninitialized probability of edge 44->41 > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: error: > Uninitialized probability of edge 36->21 > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: error: > Uninitialized probability of edge 29->36 > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: error: > Uninitialized probability of edge 32->29 > during GIMPLE pass: graphite > dump file: id-16.c.150t.graphite > /home/jakub/src/gcc/gcc/testsuite/gcc.dg/graphite/id-16.c:15:1: internal > compiler error: verify_flow_info failed > 0xafac1a verify_flow_info() > ../../gcc/cfghooks.c:268 > 0xf2a624 checking_verify_flow_info > ../../gcc/cfghooks.h:198 > 0xf2a624 cleanup_tree_cfg_noloop > ../../gcc/tree-cfgcleanup.c:901 > 0xf2a624 cleanup_tree_cfg() > ../../gcc/tree-cfgcleanup.c:952 > 0x162df85 graphite_transform_loops() > ../../gcc/graphite.c:422 > 0x162f0c0 graphite_transforms > ../../gcc/graphite.c:447 > 0x162f0c0 execute > ../../gcc/graphite.c:524 > > So probably graphite needs to be tweaked for this too.
graphite does if (changed) { cleanup_tree_cfg (); profile_status_for_fn (cfun) = PROFILE_ABSENT; release_recorded_exits (cfun); tree_estimate_probability (false); so it runs into CFG cleanup running before it properly resets counts. I wonder if we shouldn't simply get rid of the explicit checking calls in cfg cleanup... or if the profile checking should happen somewhere else. I'd also appreciate a better way for doing the above. Shouldn't we end up with a proper initialization on all edges as we just split existing ones and use create_empty_if_region_on_edge and create_empty_loop_on_edge? Ah, those use make_edge as well. The tree_estimate_probablility call above should be ideally replaced with sth like "propagate-SESE-entry-probability". Richard. > Jakub