Re: Is global optimization worth it?

nmm1@cus.cam.ac.uk (Nick Maclaren)
20 Dec 2001 00:05:57 -0500

          From comp.compilers

Related articles
Is global optimization worth it? lance.delahaye@xtra.co.nz (2001-12-15)
Re: Is global optimization worth it? nmm1@cus.cam.ac.uk (2001-12-20)
Re: Is global optimization worth it? rsherry8@home.com (Robert Sherry) (2001-12-20)
Re: Is global optimization worth it? mwso@earthlink.net (Gary Oblock) (2001-12-20)
Re: Is global optimization worth it? lex@cc.gatech.edu (Lex Spoon) (2001-12-20)
Re: Is global optimization worth it? lance.delahaye@xtra.co.nz (2002-01-24)
Re: Is global optimization worth it? lance.delahaye@xtra.co.nz (2002-01-24)
Re: Is global optimization worth it? nmm1@cus.cam.ac.uk (2002-01-24)
[3 later articles]
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 20 Dec 2001 00:05:57 -0500
Organization: University of Cambridge, England
References: 01-12-069
Keywords: optimize
Posted-Date: 20 Dec 2001 00:05:57 EST

Lance <lance.delahaye@xtra.co.nz> wrote:
>I'm starting a compiler project. I am wondering if it is worth
>ignoring global optimisations for a pascal-type scoped language. About
>how much optimisation gain is there to be had there? If its more than
>about a third, I probably shouldn't ignore it, but it would simplify
>my life quite a bit if I could.
>
>[There's no simple answer to your question. The harder you work, the
>better you can optimize. For student projects, I wouldn't bother, it's
>enough work to get any correct code at all. -John]


Yes, precisely. But, for production compilers, the issue is more to
do with the nature of the language than to do with its scoping. For
example, Pascal and Fortran can be optimised reasonable well at a
local level, because separate identifiers can usually be assumed to
refer to separate objects. C90 cannot, in general.


This is why most highly optimising C compilers rely critically on
global optimisation - it is to analyse the aliasing - and why a
'simple' movement of a function from being local to being external can
destroy the performance. And it needn't even be in a critical loop -
it just needs to potentially alias some identifier that is used in
such a loop!




Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.