This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/6007: cfg cleanup tremendous performance hog with -O1
- From: Jan Hubicka <jh at suse dot cz>
- To: Brad Lucier <lucier at math dot purdue dot edu>
- Cc: Jan Hubicka <jh at suse dot cz>, David Edelsohn <dje at watson dot ibm dot com>, gcc at gcc dot gnu dot org, mark at codesourcery dot com, feeley at iro dot umontreal dot ca
- Date: Thu, 28 Mar 2002 13:03:07 +0100
- Subject: Re: optimization/6007: cfg cleanup tremendous performance hog with -O1
- References: <20020322114115.GM22936@atrey.karlin.mff.cuni.cz> <200203250159.g2P1xGG24661@banach.math.purdue.edu>
> [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)