This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug tree-optimization/15524] [4.0 Regression] jump threadingon 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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]