Xref: utzoo comp.arch:17031 comp.lang.misc:5129 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.arch,comp.lang.misc Subject: Re: Compiler Costs Message-ID: Date: 10 Jul 90 14:20:37 GMT References: <1797@apctrc.UUCP> <1990Jul6.161158.1297@zoo.toronto.edu> <1990Jul8.230954.18881@ecn.purdue.edu> <23268@boulder.Colorado.EDU> <23285@boulder.Colorado.EDU> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 52 In-reply-to: grunwald@foobar.colorado.edu's message of 9 Jul 90 20:20:30 GMT In article <23285@boulder.Colorado.EDU> grunwald@foobar.colorado.edu (Dirk Grunwald) writes: | The MIPS compiler suite (and old bit of software, too) does global | optimization. I think that they still adhere to a set register passing | convention, but they do things like eliminate stack manipulation for | leaf procedures, etc etc. | | Several people (Steinkist & Hennessy, Wahl, Wallace) have investigated | the advantages of global register allocation at link time, and it does | very well. You don't even need to have runtime performance data to | tune the allocation; simple bottom-up coloring appears to work very | well. I've always wondered about the gains. Speaking off the cuff, I would imagine you would get gains if you limit yourself to a Fortran style of coding (no matter what language you use). By Fortran style, I mean little or no recursion, all calls are direct (not through pointers), and all routines exist when the program is loaded. In particular, calls to routines through pointers have to fall back on some sort of fixed rules such as which set of registers are caller save or callee save, and where the arguments go. Most of the object oriented programs that I'm aware of ultimately call functions through pointers, and this in fact is touted as a good thing, so that a subclass can replace a function as needed. Also in dynamic languages like LISP, the function being called may not have been created yet, or will have been replaced by the time the call is made. A weaker version of this is if your system has shared libraries -- when the link is made, the shared libraries are not bound in, they are generally bound in when either the program starts up, or an unbound function is called. I also wonder about the computational complexity of global register analysis. My experience has tended to be that register allocation is one of the more memory intensive pieces of compilers, and the size of the memory is needed scales with the number of basic blocks used and number of distinct pseudo regs requested. I could easily imagine a global register analysis phase thrashing on really large programs, unless severe restrictions where used, and those restrictions would tend to limit optimization. | Someone just needs to hack it into Gnu C. This would raise the common | denominator of compiler performance & make companies either provide | something of comparable performance or support the Gnu compiler. I | still can't believe how many systems are shipped with shitty | compilers. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Do apple growers tell their kids money doesn't grow on bushes?