Article View: comp.arch
Article #10470optimizer compilers (was Re: SPARC implementation or architecture)
From: Rob MacLachlan
Date: Fri, 26 Apr 1991 16:41
Date: Fri, 26 Apr 1991 16:41
39 lines
2754 bytes
2754 bytes
>Subject: Re: SPARC implementation or architecture
>Date: 23 Apr 91 14:01:40 GMT
>
>|> However, the major conclusion: that the two are indistinguishable,
>|> is wrong, if you think 10% is distinguishable...
>|> --
>|> -john mashey DISCLAIMER: <generic disclaimer, I speak for me only, etc>
>The last sentence is the point! MIPS marketing (at least as retold
>by DEC) is that the MIPS compiler technology provides a *HUGE*
>advantage over other RISC architectures. If the difference is
>+/- 10%, that is a whole different story.
My experience in writing an optimizing Lisp compiler has lead me to believe
that for existing non-scientific code, compiler technology can't make a huge
difference. The most important thing is to have reasonable global register
allocation. Everything else is 10% or less (though all combined can add up to
as much as 30%).
This is especially true in pointer-chasing code. Much of the vaunted flow
optimizations (strength reduction, global common subexpression, loop
invariant) are profitable mainly in code that makes intensive use of
multi-dimensional arrays. These optimizations can make all programming
easier, but especially in C, it is usually easy (and common practice) to
hand-optimize your code so that there are no loop invariants, common
subexpressions or spurious multiplications.
The reason I made the remark about "existing code" is that existing code is
usually written to assume the lowest common denominator in compilers. In more
than one sense, it is easy to write code that assumes a smart compiler:
-- Programs that are not highly tuned may do dumb things which a smart
compiler can undo. Even experienced programmers with a knowledge of
compilation technology can write code that may compile badly (especially
in a complex language like Lisp.)
-- If you are willing to assume good compiler technology (such as appropriate
inlining of small and once-called functions), then programs are easier to
write and maintain, since you don't have to be paranoid about efficiency.
Robert MacLachlan (ram+@cs.cmu.edu)
Technical Details
Message-ID:
<1991Apr26.164109.5951@cs.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!tut.cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!ramReferences:
<1991Apr18.142341.23097@rice.edu> <2500@spim.mips.COM> <1991Apr23.140140.27847@webo.dg.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!tut.cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!ram From: ram+@cs.cmu.edu (Rob MacLachlan) Newsgroups: comp.arch Subject: optimizer compilers (was Re: SPARC implementation or architecture) Message-ID: <1991Apr26.164109.5951@cs.cmu.edu> Date: 26 Apr 91 16:41:09 GMT References: <1991Apr18.142341.23097@rice.edu> <2500@spim.mips.COM> <1991Apr23.140140.27847@webo.dg.com> Sender: netnews@cs.cmu.edu (USENET News Group Software) Organization: School of Computer Science, Carnegie Mellon Lines: 39