Patch for scan_loop [Re: EGCS EXTREME optimization times...]

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Sat Feb 13 12:53:00 GMT 1999


Am Sat, 13 Feb 1999 schrieb Jeffrey A Law:
>In message < 14020.52936.784843.61964@ongaonga.elec.canterbury.ac.nz >you write
>  > Michael Hayes writes:
>  >  > The culprit is the loop optimizer (but not strength reduction this
>  >  > time).  During scan_loop, loop_reg_used_before_p is called for most of
>  >  > the loop insns and since loop_reg_used_before_p checks every loop insn
>  >  > we have quadratic behavior.  
>  > 
>  > Here's a patch that just swaps the calls to loop_reg_used_before_p
>  > and reg_in_basic_block_p.  There's no point embarking on a long search
>  > if the subsequent test will fail.  With -O2 the compilation time drops
>  > from 333 seconds to 2 seconds with David's testcase.
>  > 
>  > Michael.
>  > 
>  > 	* loop.c (scan_loop): Call reg_in_basic_block_p before
>  > 	loop_reg_used_before_p.
>This is fine.  I'm going to install it on the egcs-1.1 branch, can you please
>install it into the mainline sources?

Hmm, on the egcs_1_1_branch this patch solves this testcase on ppc-linux-gnu:

FAIL: gcc.c-torture/compile/980329-1.c,  -O2 -fomit-frame-pointer
-finline-functions -funroll-all-loops

I'm a little bit worried about that, cause this thread implied that this patch
should only improve compilation speed and not change the behaviour of the
compiler.

Thoughts?
Franz.


More information about the Gcc-patches mailing list