This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases
- From: "dberlin at dberlin dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Nov 2004 03:51:49 -0000
- Subject: [Bug tree-optimization/15524] [4.0 Regression] jump threading on trees is slow with switch statements with large # of cases
- References: <20040518194300.15524.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at dberlin dot org 2004-11-01 03:51 -------
Subject: Re: [4.0 Regression] jump threading
on trees is slow with switch statements with large # of cases
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:
>
> foreach loop
> foreach block
> if block is in loop
> code
>
>
> 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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15524