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) |
Re: Is global optimization worth it? rinie@xs4all.nl (Rinie Kervel) (2002-01-28) |
Re: Is global optimization worth it? nmm1@cus.cam.ac.uk (2002-01-30) |
Re: Is global optimization worth it? rinie@xs4all.nl (Rinie Kervel) (2002-02-06) |
From: | lance.delahaye@xtra.co.nz (Lance) |
Newsgroups: | comp.compilers |
Date: | 24 Jan 2002 13:53:59 -0500 |
Organization: | http://groups.google.com/ |
References: | 01-12-069 01-12-078 |
Keywords: | optimize, comment |
Posted-Date: | 24 Jan 2002 13:53:58 EST |
nmm1@cus.cam.ac.uk (Nick Maclaren) wrote in message news:01-12-078...
> 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!
I can see the issues with aliasing. Is there any syntax that could be
specified in the language that gets arround aliasing issues? - perhaps
extending the declarations so that at least parameter aliases are
explicitly identified? (I noted an RFC doing that for C/C++ somewhere)
Any better way which won't add more complexity for a user of the
language?
Sorry I'm not keepin up here - its that time of year though.
[In C99, if you declare something "register", you're promising never
to take its address and hence never to alias it. There's also a new
"restrict" type qualifier keyword that lets you define a pointer that
you promise points to unaliased storage. Paper copies of C99 cost a
fortune but you can buy a downloadable PDF version from ANSI for $18,
which is a bargain for a 554 page document. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.