Message ID | CAAe5K+WKXH6x_gbU7_-=fgFWGVvXPkL7-gf5RBmEY4DPA-26RA@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Thu, Dec 19, 2013 at 8:33 PM, Teresa Johnson wrote: > 2013-12-19 Teresa Johnson <> > > PR gcov-profile/59542 > * bb-reorder.c (duplicate_computed_gotos): Invoke fixup_partitions > if we have made any changes. > > Index: bb-reorder.c > =================================================================== > --- bb-reorder.c (revision 206100) > +++ bb-reorder.c (working copy) > @@ -2390,6 +2390,7 @@ duplicate_computed_gotos (void) > basic_block bb, new_bb; > bitmap candidates; > int max_size; > + bool changed = false; > > if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1) > return 0; > @@ -2486,9 +2487,17 @@ duplicate_computed_gotos (void) > new_bb->aux = bb->aux; > bb->aux = new_bb; > new_bb->flags |= BB_VISITED; > + changed = true; > } > > done: > + /* Duplicating blocks above will redirect edges and may cause hot blocks > + previously reached by both hot and cold blocks to become dominated only > + by cold blocks. This will cause the verification when leaving cfg layout > + mode to fail, and lead to now cold code in the hot section. Invoke > + fixup_partitions to address these problems. */ Please remove the "This will ... problems." part. IMHO The first sentence explains quite enough ;-) > + if (changed) > + fixup_partitions (); > cfg_layout_finalize (); > > BITMAP_FREE (candidates); > > This is OK. Ciao! Steven
On Thu, Dec 19, 2013 at 2:06 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote: > On Thu, Dec 19, 2013 at 8:33 PM, Teresa Johnson wrote: >> 2013-12-19 Teresa Johnson <> >> >> PR gcov-profile/59542 >> * bb-reorder.c (duplicate_computed_gotos): Invoke fixup_partitions >> if we have made any changes. >> >> Index: bb-reorder.c >> =================================================================== >> --- bb-reorder.c (revision 206100) >> +++ bb-reorder.c (working copy) >> @@ -2390,6 +2390,7 @@ duplicate_computed_gotos (void) >> basic_block bb, new_bb; >> bitmap candidates; >> int max_size; >> + bool changed = false; >> >> if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1) >> return 0; >> @@ -2486,9 +2487,17 @@ duplicate_computed_gotos (void) >> new_bb->aux = bb->aux; >> bb->aux = new_bb; >> new_bb->flags |= BB_VISITED; >> + changed = true; >> } >> >> done: >> + /* Duplicating blocks above will redirect edges and may cause hot blocks >> + previously reached by both hot and cold blocks to become dominated only >> + by cold blocks. This will cause the verification when leaving cfg layout >> + mode to fail, and lead to now cold code in the hot section. Invoke >> + fixup_partitions to address these problems. */ > > Please remove the "This will ... problems." part. IMHO The first > sentence explains quite enough ;-) Ok, done. > >> + if (changed) >> + fixup_partitions (); >> cfg_layout_finalize (); >> >> BITMAP_FREE (candidates); >> >> > > This is OK. Thanks, committed as r206135. Teresa > > Ciao! > Steven
Index: bb-reorder.c =================================================================== --- bb-reorder.c (revision 206100) +++ bb-reorder.c (working copy) @@ -2390,6 +2390,7 @@ duplicate_computed_gotos (void) basic_block bb, new_bb; bitmap candidates; int max_size; + bool changed = false; if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1) return 0; @@ -2486,9 +2487,17 @@ duplicate_computed_gotos (void) new_bb->aux = bb->aux; bb->aux = new_bb; new_bb->flags |= BB_VISITED; + changed = true; } done: + /* Duplicating blocks above will redirect edges and may cause hot blocks + previously reached by both hot and cold blocks to become dominated only + by cold blocks. This will cause the verification when leaving cfg layout + mode to fail, and lead to now cold code in the hot section. Invoke + fixup_partitions to address these problems. */ + if (changed) + fixup_partitions (); cfg_layout_finalize (); BITMAP_FREE (candidates);