Xref: utzoo comp.arch:17008 comp.lang.misc:5121 Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sunybcs!boulder!atk From: atk@boulder.Colorado.EDU (Alan T. Krantz) Newsgroups: comp.arch,comp.lang.misc Subject: Re: Compiler Costs Message-ID: <23268@boulder.Colorado.EDU> Date: 9 Jul 90 15:30:25 GMT References: <1797@apctrc.UUCP> <1990Jul6.161158.1297@zoo.toronto.edu> <1990Jul8.230954.18881@ecn.purdue.edu> Sender: news@boulder.Colorado.EDU Reply-To: atk@boulder.Colorado.EDU (Alan T. Krantz) Organization: University of Colorado, Boulder Lines: 35 In article <1990Jul8.230954.18881@ecn.purdue.edu> hankd@dynamo.ecn.purdue.edu (Hank Dietz) writes: >In article <1990Jul6.161158.1297@zoo.toronto.edu>: >>In article <1797@apctrc.UUCP> zrra07@backus (Randall R. Appleton) writes: >> >>It can be negative. Good optimizing compilers can often do a better >>job on large bodies of code than humans can. Small code fragments >>often do better when carefully crafted by humans, although this is >>a very time-consuming activity. > >Basically, I agree. Given the caveat that good compilers are quite >rare, I have seen good compilers consistently outperform handwritten >assembly code -- but humans could usually do local tweaks to compiler >generated code to speed it up even a little more. I'm not so sure I've seen this very often. It seems that on some of the newer machines (IBM RS/6000) which have very special conditions for optimizing the pipeline this might be more accurate - but on many machines it isn't. The trick is when you hand write assembly code you get to optimize register usage across routine calls much better then most compilers can (actually, to be honest I haven't seen any compilers do global register optimization - though this is an area of active research). Anyways, almost every comment I've seen on compilers vs hand optimization has been on a routine by routine case - and I still believe (though I could be wrong) that the optimial results from assembly code comes from register usage across/through routine calls... Ho hum - I'm sure someone will set me straight .... ------------------------------------------------------------------ | Mail: 1830 22nd street Email: atk@boulder.colorado.edu| | Apt 16 Vmail: Home: (303) 939-8256 | | Boulder, Co 80302 Office: (303) 492-8115 | ------------------------------------------------------------------