Fix PR 53743 and other -freorder-blocks-and-partition failures (issue6823047)

Jan Hubicka hubicka@ucw.cz
Fri May 10 11:52:00 GMT 2013


> On 05/07/13 23:13, Teresa Johnson wrote:
> >----------------------
> >Revised patch that fixes failures encountered when enabling
> >-freorder-blocks-and-partition, including the failure reported in PR 53743.
> >
> >This includes new verification code to ensure no cold blocks dominate hot
> >blocks contributed by Steven Bosscher.
> Seems like a reasonable verification; presumably if we have a cold
> block dominating a hot block, then the block/edge frequencies are
> badly broken.  Ah, just saw the comments for the other case where
> this happens.  cold entry, but hot loop inside pushing over the
> barrier. Arguably given a cold block in the dominator graph, all its

Yep, also note that sanity checking anything about frequencies is really hard.
There are very many places in compiler that necesarilly need to invalidate
frequencies in weird ways (at least short of rebuilding the whole profile
from probabilities again).

> I can't really comment on the cfglayout and related stuff -- it was
> added at a time when I wasn't doing much with GCC and thus I don't
> know much about it.

I think I can take a look at the cfglayout stuff. Splitting the patch would be great.

Honza
> 
> However, I like the changes to record if we've done partitioning and
> checking those instead of flag_reorder_blocks_and_partition.  That's
> simple enough that I'd support pulling it out as a separate patch
> and installing immediately if that can be done so without major
> headaches.
> 
> I think we could do something similar with the code to verify the
> idom of a hot block is also hot.  Though looking at the
> implementation I wonder if it could be simplified by walking the
> dominator tree?  I can't look at it real closely tonight though.
> 
> Could you pull those two logical hunks of work out into individual
> patches.
> 
> jeff



More information about the Gcc-patches mailing list