Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!sdd.hp.com!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.arch Subject: Re: Optimising C compiler question Message-ID: Date: 18 Apr 91 19:06:44 GMT References: <1991Apr8.193155.3911@vax5.cit.cornell.edu> <1991Apr11.003431.24918@alzabo.ocunix.on.ca> <9526@cognos.UUCP> <1991Apr15.134417.24380@bigsur.uucp> <9537@cognos.UUCP> Sender: news@OSF.ORG Distribution: comp Organization: Open Software Foundation Lines: 26 In-reply-to: kcollins@convex.com's message of 18 Apr 91 16:19:19 GMT In article kcollins@convex.com (Kirby L. Collins) writes: | In <9537@cognos.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: | | >If the compiler considers both paths equally likely it may | >continue to assign the single register to j, or could dump and load j | >and k into the single register as required. However, we have information | >the compiler doesn't, to wit that the "j" path will not normally be | >executed, so we can see that allocating a register to j but not k, or | | Rather than provide a means for the programmer to "hand optimize" register | allocation, a more useful solution would be to give the programmer a way | to inform the compiler about branch frequency. If the compiler has as | much information as the programmer, it ought to do as good or better a | job than the programmer (we hope $-). I seem to remember that Fortran-II had a frequency statement, and that it was removed because they discovered the users were usually wrong. I think it's much better if you have some tool that automagically records which way the branches go, and run the program(s) under the appropriate test harnesses. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?