optimization/6007: cfg cleanup tremendous performance hog with -O1
Jan Hubicka
jh@suse.cz
Thu Mar 28 06:39:00 GMT 2002
> [RE: crossjumping]
>
> > I will try to check whether I can squeze out some more cycles or
> > find way how to limit this.
>
> My code uses a lot of computed goto's, with many labels. Is crossjumping
> possibly a win in this case? Can it ignore these jumps?
>
> Brad
Hi, here is patch I made as a test. It simply disables crossjumping
if there is moer than 100 outgoing edges. Unfortunately I can't benchmark
your testcase as my machine runs out of space before getting there. Can you
check if this solves your problem? If so, I will prepare more polished
version of this patch.
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgcleanup.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 cfgcleanup.c
*** cfgcleanup.c 2002/03/22 11:18:33 1.45
--- cfgcleanup.c 2002/03/28 11:44:48
*************** try_crossjump_bb (mode, bb)
*** 1467,1472 ****
--- 1467,1473 ----
{
edge e, e2, nexte2, nexte, fallthru;
bool changed;
+ int n = 0;
/* Nothing to do if there is not at least two incoming edges. */
if (!bb->pred || !bb->pred->pred_next)
*************** try_crossjump_bb (mode, bb)
*** 1475,1483 ****
/* It is always cheapest to redirect a block that ends in a branch to
a block that falls through into BB, as that adds no branches to the
program. We'll try that combination first. */
! for (fallthru = bb->pred; fallthru; fallthru = fallthru->pred_next)
! if (fallthru->flags & EDGE_FALLTHRU)
! break;
changed = false;
for (e = bb->pred; e; e = nexte)
--- 1476,1488 ----
/* It is always cheapest to redirect a block that ends in a branch to
a block that falls through into BB, as that adds no branches to the
program. We'll try that combination first. */
! for (fallthru = bb->pred; fallthru; fallthru = fallthru->pred_next, n++)
! {
! if (fallthru->flags & EDGE_FALLTHRU)
! break;
! if (n > 100)
! return false;
! }
changed = false;
for (e = bb->pred; e; e = nexte)
More information about the Gcc
mailing list