Re: Is global optimization worth it?

nmm1@cus.cam.ac.uk (Nick Maclaren)
24 Jan 2002 16:10:49 -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)
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)
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 24 Jan 2002 16:10:49 -0500
Organization: University of Cambridge, England
References: 01-12-069 01-12-078 02-01-098
Keywords: optimize
Posted-Date: 24 Jan 2002 16:10:49 EST

>I can see the issues with aliasing. Is there any syntax that could be
>specified in the language that gets arround aliasing issues?


>[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]


Precisely. I think 'restrict' is evil (and its author wasn't entirely
happy with it), but those of us who looked into it deeply reckoned it
was close to the best you could do starting with C as she is spoke.
As far as I can see, it should make C as optimisable as Fortran. And
I am a notorious nitpicker :-)


It is extremely unlikely that any vendor will make use of restrict
in all its glory, but a lot intend to use it to optimise arrays passed
as pointers (think the BLAS and LAPACK). It is permissible to do just
that, and otherwise ignore it for optimisation.


The other advantage of restrict is that the user doesn't have to
worry about it - only library developers and compiler writers do. If
the user does something sensible, it won't get in the way. If he
plays perverse games without understanding what he is doing, he will
get what he deserves.


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.