https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69609

--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Richard Biener from comment #6)
> Maybe sth as simple as
> 
> Index: gcc/bb-reorder.c
> ===================================================================
> --- gcc/bb-reorder.c    (revision 233262)
> +++ gcc/bb-reorder.c    (working copy)
> @@ -889,6 +889,7 @@ bb_to_key (basic_block bb)
>  
>    /* Prefer blocks whose predecessor is an end of some trace
>       or whose predecessor edge is EDGE_DFS_BACK.  */
> +  if (EDGE_COUNT (bb->preds) <= 8)
>    FOR_EACH_EDGE (e, ei, bb->preds)
>      {
>        if ((e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun)
> 
> or precomputing whether a BB has abnormal preds and disabling the trace in
> that case (or somehow sorting the edge vectors so that abnormal edges
> come last so we can stop at the first abnormal edge).

I tried this patch and it changes compile time from something
more than ten minutes to 1m57s.

More than five times faster looks good to go to me.

Reply via email to