A question about integer promotion in GCC

Nathan Sidwell nathan@codesourcery.com
Mon Sep 6 09:54:00 GMT 2004


Joseph S. Myers wrote:
> I agree we want to run it multiple times on GIMPLE.  Putting the existing 
> fold just before gimplification is to avoid regressions.  Because folding 
> of subexpressions feeds back into optimisations on the full expression, 
> things can't be removed from the existing fold without potential for 
> regressions until all the optimisations have been implemented to work on 
> GIMPLE; just as it's taking a while to eliminate cases some RTL passes get 
> which tree-ssa doesn't so that those RTL passes can be removed.  While the 
> implementation of everything for GIMPLE is something that can and so must 
> be done incrementally, each optimisation placed there improving the 
> optimisation of programs that use explicit temporaries rather than 
> complicated expressions.

Ah, I see we're actually sort of in agreement.  I'd prefer not to see the
stepping-stone pre-gimple stage you propose -- mainly as a driver to force
the other optimizations to be written.  Perhaps the simplest way to do this
is to keep the current fold as a selectable pre-gimple pass during the
transition.  That way we (a) guarantee we can't be regressing, (b) can
turn it on and off at will, thereby determining if the remaining optimizers
are missing stuff, (c) don't have to rewrite it as a temporary pass.

Let's revisit this when the branch actually happens.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc mailing list