[PATCH] [RFC] loop index promotion pass

Mark Mitchell mark@codesourcery.com
Tue May 19 23:06:00 GMT 2009


Richard Guenther wrote:

>>>> Bootstrapped on x86_64-unknown-linux-gnu.  Comments welcome.

> Ok, I did that.  It regularizes the code, but with no effect on the generated
> code.  It seems that SCEV analysis is confused enough to not be able to
> compute the scalar evolution for the loads at all (I didn't yet "fix" the
> SCEV code wrt no-undefined-overflow semantics though).

Nathan's new pass has significant impact on benchmarks that people
routinely use to judge GCC.  These benchmarks are based on real-world
code; a lot of code for 8- and 16-bit machines used "short" in lots of
places because that was faster, and that code is now running on 32-bit
machines.  So, I don't think the pass is purely a benchmark hack -- but
even if it was, I think that GCC having good benchmark numbers is a good
thing, if that doesn't interfere with its other goals.

I think we should accept the patch (modulo, of course, any fixes
required in the ordinary course of review), unless someone sees a
better, and relatively easy, way to provide the same benefit.  We can
always rip it out if there turns out to be a better way.

(For avoidance of doubt, CodeSourcery has no commercial reason to care
whether -fpromote-loop-indices makes it into the FSF tree or not.)

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list