This is the mail archive of the
mailing list for the GCC project.
Re: [Bug tree-optimization/15524] [4.0 Regression] jump threadingon trees is slow with switch statements with large # of cases
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jeffrey A Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gcc-bugzilla at gcc dot gnu dot org
- Date: Sun, 31 Oct 2004 22:51:43 -0500 (EST)
- Subject: Re: [Bug tree-optimization/15524] [4.0 Regression] jump threadingon trees is slow with switch statements with large # of cases
- References: <firstname.lastname@example.org>
On Sun, 31 Oct 2004, Jeffrey A Law wrote:
More work to speed up 15524. I was rather puzzled that "expand" was
being charged with 30% of the compilation time. I originally thought
there was some lameness in the switch statement expanders. However,
it turned out I was totally wrong.
The culprit is actually the code to record the number of iterations
of each loop. We never pushed a timevar for that pass and thus the
time was charged to whatever was on the top of the timevar stack
(which happens to be TV_EXPAND).
The code to record the number of loop iterations was being rather
dumb. It basically did something like:
if block is in loop
Clearly the problem is second loop -- it's walking *all* the blocks
and testing for loop membership. Ouch.
I actually had fixed this as part of my last patch, but was waiting till
monday to commit it.